fix typo in usage for IMPLEMENT_STATIC_REQUEST_LOCAL

Summary: Closes #2899

Reviewed By: @ptarjan

Differential Revision: D1373800

Pulled By: @JoelMarcey
Avoid persisting stream filters across requests (stream_filter_register)

Summary: Closes #2900

Reviewed By: @ptarjan

Differential Revision: D1373808

Pulled By: @JoelMarcey
Make it clearer to gcc that open(2) is never called with O_CREAT without mode

Summary: We already ensure that this is never done, but `gcc` isn't smart enough to tell that.
Closes #2898

Reviewed By: @ptarjan

Differential Revision: D1373801

Pulled By: @JoelMarcey
Fix incorrect access to cold() and frozen()

Summary: You can't access cold() unless you own the CodeCache,
because it depends on the CodeCache's m_selection. This is
currently causing asserts to fire if you ask for the tc usage
via the admin port while we're jitting.

Use realCold, and realFrozen instead.

Reviewed By: aravind

Differential Revision: D1372564
don't buffer overrun on bad DNS TXT records

Summary: The TXT record is transmitted as

    ...stuff... [record length] ...stuff... [chunk length] chunk [chunk length] chunk ...

We preallocate a buffer of size `record length` but if any `chunk length` goes longer than that we happily overrun the end of the array. php5 is vulnarable to this as well. I'll send a PR.

Reviewed By: bertrand, joelm

Differential Revision: D1373942
bump tested guzzle4 version

Summary: Should stop raciness between guzzle3 and guzzle4 trying to use the same port.

Reviewed By: @JoelMarcey

Differential Revision: D1374311
Use makePseudoMainExit in more places

Summary: These exits are only used if we're in a pseudomain, so don't
do the work of generating them unless we have to.

Reviewed By: @ottoni

Differential Revision: D1373537
Attempt to make fsockopen_connect.php less flaky

Summary: It was assuming that 1ms was always enough time for the connection to
open but it's been failing on contbuild occasionally.

Reviewed By: @bertmaher

Differential Revision: D1374617
Fix blank line bug with JSON_PRETTY_PRINT

Summary: Ported https://bugs.php.net/bug.php?id=66021.
Closes #2877
Fixes #2869

Reviewed By: @ptarjan

Differential Revision: D1370969

Pulled By: @JoelMarcey
Band-aid apparently incorrect assertion in SimpleVariable::analyzeProgram

Summary: This is asserting something isn't a parameter when it doesn't
have various contexts flags, but it's not true if you didn't run with
PostOptimization and GenerateInferredTypes set, which are both
user-controlled flags.  I suspect the bug is the assert, not somewhere
else, but I don't know the code well enough to be sure.

Reviewed By: @markw65

Differential Revision: D1371177
Add --inheritance-children and --inheritance-ancestors to hh_client

Summary: Add `--inheritance-children X` and ``--inheritance-ancestors X` to `hh_client` which returns a list of either children or ancestor classes and methods to `X`.  This will be used in FBIDE to allow for jumping between interfaces and implementations of classes and methods.

Reviewed By: @pikatchu

Differential Revision: D1363095
reverse crazy boolean in repo code

Summary: Returning false for success and true for failure was totally making me crazy

Reviewed By: @jdelong

Differential Revision: D1374027
remove anything after a ? too

Summary: Heroku is running into this problem with their current apache rewrite rules

Reviewed By: @JoelMarcey

Differential Revision: D1374358
Fix WithRef iterator creation

Summary: It looks like we were always calling the non-with-ref variant
of new_iter_array_cold.

Reviewed By: @jdelong

Differential Revision: D1372076
remove lang option and associated parsing

Summary: Remove unnecessary option and associated parsing.

Reviewed By: @avikchaudhuri

Differential Revision: D1374959
Enable warnings in C files in ocaml, and fix some warnings in Hack

Summary: This should have been on, whoops. Mostly minor stuff, some of
which is spewing in the OSS build.

Reviewed By: @ptarjan

Differential Revision: D1375062
Clear all existing keys before testing getAllKeys

Summary: This allows the test to work, even if the memcache instance is dirty. Also moves the test into the `ext_memcached` folder.
Closes #2875

Reviewed By: @ptarjan

Differential Revision: D1370972

Pulled By: @JoelMarcey
Allow Repo::loadGlobalData to fail and print SrcKey's resumed flag

Summary: Print the SrcKey's resumed flag so we can more easily figure out why
we have multiple translations for the same md5 + bytecode offset.

Also, running hhvm -vEval.DumpTC=1 and then tc-print was failing
because there was no global data in the repo.  So allow
Repo::loadGlobalData to fail in this case.

Reviewed By: @swtaarrs

Differential Revision: D1372475
Stop storing two models in hh_ide.js

Summary: Motivation: As more and more code gets converted to hack, we're pulling more and more dependencies into hh_ide.js. The model is getting too big, and it's going to start crashing chrome for people. (This is started to happen occasionally to people now)

I tried adding deps like they were decl (as discussed with Josh when we were talking about this), but it only reduced the number of files added by 10%. :(

This should be a much bigger win. I think this code is basically legacy stuff from when we first integrated this. We were holding two models, one for typechecking and one for autocomplete. There doesn't seem to be much reason to do this now (especially now that @pikatchu is making us not stop on errors).

I'm hoping I'm not missing something here and that this is ok to do.

Seems like a reasonable assumption that holding one model instead of two will cut our declare_file time in half and the model size in half. This should buy us a bunch of time.

Reviewed By: @jwatzman

Differential Revision: D1374505
Use `detach()` instead of an empty array for removing stream filter persistence across rrequests

Summary: D1373808 did this, but as @markw65 pointed out, an empty array may not be the most efficient way.

Reviewed By: @markw65

Differential Revision: D1374219