Reduce from four ways to look up Unit*'s to one

Summary: The 'eval' vs. 'lookup' distinction doesn't make
sense---neither of them did any evaluation.  I also didn't know what
an "include root" was or why you'd want to look one up.  Refactor
things so there's just lookupUnit (still on ExecutionContext for now).

Reviewed By: @bertmaher

Differential Revision: D1384187
Don't use FileRepository to find systemlib md5s

Summary: There's no need to do this---we can just ask the repo.

Reviewed By: @swtaarrs

Differential Revision: D1386880
Move lookupUnit out of ExecutionContext

Summary: Intermediate refactoring step.

Reviewed By: @alexmalyshev

Differential Revision: D1386881
Break more dependencies on PhpFile* outside of file-repository.cpp

Summary: EvaledFilesMap and debugger stuff still used these, but only
to call getFileName().  After some investigation, it looks like
phpFile->getFileName() is always equivalent to
phpFile->unit()->filepath() (we set the unit's filepath to the same
string we're going to pass the PhpFile constructor), even with
Eval.CheckSymLink on, so we can skip it.  While looking through this I
noticed m_evaledFilesOrder was being added to even if we're doing a
non-initial include of a file we've already included via a different
path, which makes the results of get_included_files not match php5, so
this diff also fixes that.

Reviewed By: @alexmalyshev

Differential Revision: D1386883
Hide the rest of FileRepository guts into its implementation

Summary: A few utility functions are still exported, but the main API
to this module is now just "lookupUnit", which is hopefully
understandable enough that it should be easy to replace the internals
with something more sane now.  (Later diff renames the file, it's a
"FileRepository" isn't a thing anymore.)

Reviewed By: @swtaarrs

Differential Revision: D1386886
Reflow various documentation to 79 columns

Summary: mwang and bsimmers like it better.

Reviewed By: @swtaarrs

Differential Revision: D1386888
Separate RepoAuthoritative Unit caching from the rest of the code

Summary: It's different enough that this seems less complex.  (And it already
made use of an entirely separate ConcurrentHashMap, anyway.)

Reviewed By: @mxw

Differential Revision: D1386891
Rewrite non-repo version of the thing formerly known as FileRepository

Summary: It was buggy, and had evolved poorly.

The main bug related to the ~PhpFile codepaths and the md5 map.  A treadmilled
PhpFile could be reused even though its unit was scheduled to be deleted.  This
diff fixes the race by having clearer ownership, and eliminating the md5 map.

Rationale on not reimplementing the md5-based cache for now: we are including
the file's path into the md5 to avoid sharing the "same" unit for files with
different paths (it would break the "Dir" and "File" opcodes as currently
implemented).  We also already have a cache to avoid starting from scratch if
the contents are the same (the Repo), so this only only can save on duplicating
JIT time/space, and Unit load time.  It also shouldn't be hitting very often: I
think the main case is if you manage to have the mtime change on a file without
the file contents actually changing.  Multiple copies of the "same" file for
different www checkouts on a shared server won't be getting shared Units right
now, and switching branches and then switching back can only reuse the Unit if
it either goes through the buggy code path and reused it even though it was
treadmilled or if the unit wasn't loaded since the time you were on the
previous branch.  So, I'm thinking let's make it simpler now and optimize it
again if we need to later.

Reviewed By: @swtaarrs

Differential Revision: D1386893
Rename file-repository to unit-cache

Summary: This is just a rename diff.  It's on top of everything else so we can
choose different names without me needing to rebase, if anyone has a better
naming idea.  This seems like a reasonable name, although both resolveVmInclude
and mangleUnitMd5 feel slightly out of place now (but resolveVmInclude (and
resolve_include) are pretty convoluted for historical reasons and deserving of
their own cleanup pass anyway, which I'm going to consider out of scope for now
since it's not causing bugs as far as we know ...).

Reviewed By: @mxw

Differential Revision: D1386894
Still use RankedCHM for unit-cache; rename the rank

Summary: I haven't changed anything to stop us from holding these tbb locks for
long periods of time, and these assertions have caught bugs, so they should
stay.  (I forgot about it in D1386893.)

Reviewed By: @elgenie

Differential Revision: D1396824
A few comment tweaks in the file-repository diff stack

Summary: Stuff from some review comments.  (So I don't have to rebase them
through the stack.)

Reviewed By: @swtaarrs

Differential Revision: D1408001
Hack can build on OSX now

Summary: Closes #3051

Reviewed By: @ptarjan

Differential Revision: D1408166

Pulled By: @JoelMarcey
Split off libxml extension and convert to HNI

Summary: The libxml extension was in ext_simplexml.cpp. I don't think we need
multiple extensions per file. Also converted to HNI. Constant
registration was adapted from PHP 5.6.0-dev, using the libxml error
files as a source instead of hard-coding everything as is required by
constants.idl.json.

Moving LibXMLError from IDL to a systemlib fixes the serialization
failure which, despite being included in an expectf file, does not occur
in PHP. Updated the expectf file to match the PHP output.

* Made a header file for libxml_use_internal_error() and
  libxml_add_error() instead of repeating the definitions.
* Cache a Class pointer in a static variable, following
  the example of ReflectionException.
* Rename LibXmlErrors to LibXmlRequestData, since it contains more than
  just errors.

Submitted on behalf of a third-party: The PHP Group
Source: PHP 5.6.0-dev
License: version 3.01 of the PHP license
Closes #3012

Reviewed By: @fredemmott

Differential Revision: D1397523

Pulled By: @JoelMarcey
Use flags from ArrObj/ArrIt when constructed from ArrObj/ArrIt

Summary: Fixes zend test.
I don't include a test, because that zend test is pretty straightforward for this one
Closes #3026

Reviewed By: @fredemmott

Differential Revision: D1400296

Pulled By: @JoelMarcey
Ignore all output after request end

Summary: `register_postsend_function` allows user code to be run after the request has
be finished. However, because these functions are just arbitrary user code,
they can produce output themselves. There is no sensible way to handle output
at this stage, and it was causing a failure in the FastCGI transport.

This patch makes transports ignore all output once onSendEnd has be called.
This means that cli behaviour is unchanged.

Fixes #2882
Closes #2923

Reviewed By: @ptarjan

Differential Revision: D1381704

Pulled By: @JoelMarcey
Flakeylist some joomla and phpbb3 tests

Summary: Found via --isolate :D

Reviewed By: @JoelMarcey

Differential Revision: D1408501
Refactor Autocomplete - Complete Globals

Summary: -Take out trying to complete globals in javascript. We don't know enough about the global world. The IDE just needs to know that we tried to complete a global and then it can go to the server (as it is already doing)
-Move complete globals into autocompleteService. Made it produce actual autocomplete result objects.
-Moved the logic that hack javascript had to include types for classes/functions into autocompleteService so that vim users get it.

Reviewed By: jwatzman, julienv

Differential Revision: D1398064
change warning to notice

Summary: matching php5

Reviewed By: @JoelMarcey

Differential Revision: D1408389