Fix wrapping of strings longer than line length

Test Plan: Updated test.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3316
Allow adding Futures to a FutureIterator while running

Test Plan: arc unit FutureIteratorTestCase (it could have a lot more tests in it)

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3323
[hql -> sql] make hql the same as sql

Summary:
HQL is basically the same as SQL.
This file has no sense of alphabetical order though, so I just stuck it
somewhere.

Hopefully I did this right? Checkout the repo, added the one line...

Test Plan:
http://phabricator.katherine.dev4975.snc6.facebook.com/D24087?vs=on&id=71127&whitespace=show-all#41e34e4c

(an hql file does in fact show highlighting)

Reviewers: vrana

Reviewed By: vrana

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D3329
Improve usefulness of HTTPStatus exceptions

Summary:
Some Phabricator errors produce a 500 response, which we curently render like this from Conduit:

  $ arc diff --only
  Exception
  [HTTP/500]
  (Run with --trace for a full exception trace.)
  $

This is pretty worthless, and `--trace` does not help. Instead, show the first part of the body:

  $ arc diff --only
  Exception
  [HTTP/500] Internal Server Error
  As received by the server, the request had a nonzero content length but no data. Normally this indicates that it exceeds the 'post_max_size' setting in the PHP configuration on the server. Increase the 'post_max_size' setting, or reduce the size of the request (request size according to 'Content-Length' was 518, 'post_max_size' is set to 256).
  (Run with --trace for a full exception trace.)
  $

Test Plan: See above.

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3319
Add a data structure for file trees

Summary: Simple class to make it easier to render and manage file trees.

Test Plan: Built left-side local navigation in Differential, see next diff.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1591

Differential Revision: https://secure.phabricator.com/D3354
Implement a Pygments-like lexer for PHP in libphutil

Summary:
hey guys I invented something I think I will call it the "wheel"

See discussion in D3332.

Test Plan: Unit tests. This probably needs a few additional tweaks, but I'll add some higher-level coverage once I expose it as a syntax highlighter.

Reviewers: vrana, alanh

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1602

Differential Revision: https://secure.phabricator.com/D3336
Build a PhutilLexer-based highlighter

Summary: See D3336, D3332. This lexer is approximately 20x faster than Pygments for code snippets (i.e., ~30ish lines of code).

Test Plan: See screenshots.

Reviewers: vrana, alanh

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3337
Simplify ignoring case in lexer

Summary:
I like the expressiveness of regexps.
Plus almost everything is case insensitive in PHP, it was hard to find something which is not for the test case.

Also added more case insensitive checks and included 'S' flag mentioned at D3336#7.
Also used identifier pattern in function definition.

Test Plan: New test case.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3366
Exposing stateWriteComplete in HTTPFuture to allow for more robust asynchronous http request solutions.
Merge pull request #16 from indiefan/master

Exposing stateWriteComplete.
Fix PhutilRemarkupEngine tests

Summary: Broken since D3336.

Test Plan:
  $ arc unit

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3381
Minor, fix an XHPAST Makefile path. See T1717.
Allow libphutil to start up in the presence of missing global functions

Summary:
See D3393.

  - When we fail to load a symbol, try to load everything else before we throw. Throw an arbitrary one of the failure(s) since it's not terribly important which one we pick.
  - When loading global functions fails, proceed anyway.

Test Plan: Removed a function, ran arc liberate, it was nuked from the library map.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3395
Support HTTPS proxies in libphutil

Summary:
When we connect via an HTTPS proxy (see detailed instructions in T1747), we get a response like this:

```
HTTP/1.0 200 Connection established

HTTP/1.1 200 OK
Normal-Http-Headers: values
More-Normal-Heders: blah

<html>actual response body</html>
```

Add code to drop these blocks when parsing responses, similar to how we drop "HTTP/1.0 100 Continue" header blocks already.

Test Plan: Followed instructions in T1747 and got normal operation with connections logged in Charles rather than unmitigated failure.

Reviewers: dreiss, vrana, btrahan

Reviewed By: dreiss

CC: aran

Maniphest Tasks: T1747

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