Default to openssl_random_pseudo_bytes instead of /dev/urandom.

Summary: When available, prefer php's built in openssl_random_pseudo_bytes() to /dev/urandom.  Test for functionality and fallback to /dev/urandom if necessary to get data.  Simplifies the code a bit, and is somewhat more functional as running inside a chroot is now possible.

Test Plan: Add unit test for readRandomBytes() Would be nice to have someone test this on windows.  Working on ubuntu at the moment.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7528
Allow using numbers and HTML fragments in translations together

Test Plan: Wrote a test, watched it fail.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7532
Add `urisprintf()` for encoded printing of URIs

Summary:
Ref T1049. This is primarily to enable us to do a reasonable job of variable replacement in "Request URI" Harbormaster build steps. For example, the user will enter:

  http://jenkins.mycompany.com/?diff=${buildable.name}

...which we'll transform to:

  http://jenkins.mycompany.com/?diff=%s

...and then build correctly.

Test Plan: Unit tests.

Reviewers: btrahan, hach-que

Reviewed By: hach-que

CC: zeeg, aran

Maniphest Tasks: T1049

Differential Revision: https://secure.phabricator.com/D7538
Provide helper function for <div class="%s">%s</div>

Summary: I don't like helper functions but this is used often and it makes the code more readable.

Test Plan: Will use it.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7545
Allow self-closing <frame>

Test Plan: Used in `PhabricatorXHPASTViewFramesetController`.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7548
Allow PhutilChannels to have their write channels closed explicitly

Summary: Ref T2230. This simplifies some tests and cleans up some TODOs in the hosting stuff. See `testCloseExecWriteChannel` for an example of where we need this in practice.

Test Plan: Ran unit tests; commented out the `closeWriteChannel()` calls and got test failures instead of hangs.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2230

Differential Revision: https://secure.phabricator.com/D7552
Add some utilities for dumping Channel transcripts to a logfile

Summary: These are helpful when debugging Channel stuff, e.g. the SSH repo stuff in Phabricator.

Test Plan: Used these to help debug some issues.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7560
Change bin/sh to bin/bash in an obscure script

Summary: Packaging tools are tripping up on this since it has bashisms. Just
make it a bash script.

Auditors: btrahan
Fix a minor formatting issue in the service call log

Summary: There was already a "conduit" branch for real Conduit calls which I
missed. Reuse it for in-process service calls.

Auditors: btrahan
Mark build_xhpast.sh as a bash script, too

Summary: See previous similar commit.

Auditors: btrahan
Improve performacne of PhutilSymbolLoader

Summary: Currently, we build way more symbols than we need to when doing `loadObjects()`. Instead, select only the candidates we know will match the request.

Test Plan: 650ms -> 380ms on Differential revision page, which hits this more than it probably should.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7584