Fix HNI types for hhbbc

Reviewed By: @jdelong

Differential Revision: D1182918
Refactor and define constants

Split code into multiple files. Define imagick constants.
Refactor before implement ImagickDraw and Imagick classes in Imagick extension (#954)

Reviewed By: @ptarjan

Differential Revision: D1181811
Version guard imagick constants

Differential Revision: D1186486
Remove VarEnv/RequestArena

Based on a discussion with @edwinsmith we wondered if this was still
providing us value as it messes up some of our memory accounting.

Reviewed By: @jdelong

Differential Revision: D1179245
Implement support for PHP5.6's __debugInfo() magic method

var_dump() and print_r() serialize object properties
from __debugInfo() magic method (if present) or using the real
object props if not.

Reviewed By: @ptarjan

Differential Revision: D1180121
Release Elf object after extracting embedded data

elf_begin mmap's the file it's given, so we were ending up
with multiple copies of the hhvm binary loaded whenever we made
multiple calls to get_embedded_data, leading to a huge amount of
virtual memory allocated.

This was causing several CLI-mode flib tests to fail when run with a
finite ulimit.

Reviewed By: @alexmalyshev

Differential Revision: D1179488
Fix construction of Trace::Bump in hhbbc/index.cpp

Clang complains about kSystemLibBump being too big to convert to a
boolean, figuring the arguments are just swapped.

Also silence warning on a Collection::Type never being >=
Collection::MaxNumTypes.

Reviewed By: @jdelong

Differential Revision: D1184067
re-enable TestServer

I want to see what was being flakey about it. (alterior motive, I'm killing .hdf files and that will change this a lot so I want it to at least be running).

Reviewed By: afrind

Differential Revision: D1170742
Update SimpleXML getBool call in runtime options.

Update SimpleXML getBool call in runtime options.

Closes #1891

Reviewed By: @fredemmott

Differential Revision: D1184751

Pulled By: @scannell
Add missing memcached extension constants

Add in the Memcached extension class constants
RES_INVALID_HOST_PROTOCOL and RES_NOT_SUPPORTED

Closes #1886

Reviewed By: @fredemmott

Differential Revision: D1184755

Pulled By: @scannell
Fix some order-of-initialization issues in hhvm

Showed up as issues with binutils-2.24

Reviewed By: @jdelong

Differential Revision: D1183069
Add comprehensive test for PHINQ

This test consists of a fully featured query provider for SQLite3 plus a number of query expressions that cover most of the logic. As a consequence of doing the query provider and test cases a number of bugs came to light and it became clear how to lift various restrictions. Some highlights:
1) Instead of using the arguments to function calls to decide if they should happen client-side or server-side (which breaks down for constant arguments), there is now the convention that server-side function names are prefixed with q_.
2) Any expression in a select clause that can be evaluated server-side is now retained and sent to the server.
3) The consequent changes to the select clause call back closure brought to light a problem with how the closures were constructed, which manifested itself as silent optimization failures in repo mode. This diff hopefully fixes that.

Reviewed By: @paroski

Differential Revision: D1184868
Remove incorrect assertion about proflogues

This assertion fires regularly in debug builds, because it's
not true.  It asserts that, during regeneration of PGO prologues, if a
translation has a generated prologue (other than the default unique
stub) that it also has an entry in the profile data.  This can broken
because we discover new candidate functions for profiling during
interpretation.  The sequence is: (1) a prologue for a non-AttrHot
function is generated; (2) meanwhile, that function executes in the
interpreter enough times to be marked AttrHot; (3) upon retranslation,
this function has a translated prologue but no profData entry.

There's not really a good way to get this right (you could try to
regenerate proflogues upon AttrHot promotion, but that's dependent on
having the write lease, so could still fail), but fortunately there's
no correctness issue here - we'll just sometimes retranslate with less
profile data than we might have liked.

Reviewed By: @swtaarrs

Differential Revision: D1182212
Change behavior of fstat() for un-statable streams

Match zend - return false instead of throwing an exception. Yes, the docs say it returns an array. This isn't true.

This also changes the behavior of http:// streams to match Zend, but can't really write an isolated test for that.

refs guzzle/guzzle#538

Reviewed By: @ptarjan

Differential Revision: D1184899
Make message of NotSupportedException more accurate

It seems like most of these are "we have not implemented yet", where as the message implies that we will not ever implement it.

Reviewed By: @ptarjan

Differential Revision: D1184964
Ignore object parameter when invoking a static method via reflection

- docs say it should be null
- zend doesn't actually care
- guzzle actually passes the ReflectionMethod back in in some tests (refs guzzle/guzzle#538)

Reviewed By: @ptarjan

Differential Revision: D1185033
Moar test_server fixes

Re-enable the test but mark it extended so it only runs 1x a day.  Pass correct pidfile option.  Other changes to support enabling FB specific server test.  Give an explicit repo path to prevent loading via nfs.

Reviewed By: @ptarjan

Differential Revision: D1185297
Fix serialization to CodeModel of ParameterExpressions with attributes

Fixed cut & paste error.

Reviewed By: @paroski

Differential Revision: D1184874
Rename Frozen -> Fixed

This diff renames Frozen{Vector,Map,Set} to Fixed{Vector,Map,Set}.

Reviewed By: @dariorussi

Differential Revision: D1184610
Zend tests suites that are subsets of the entire collection

The whole suite is big.

Reviewed By: @swtaarrs

Differential Revision: D1179556