Corrected ZipArchive:extractTo when directory already exists

Summary: contbuild didn't run all tests and I ended up pushing a broken revision (D1338143). This diff corrects it.
The broken test was hphp/test/zend/good/ext/zip/tests/oo_extract.php

Reviewed By: @scannell

Differential Revision: D1342812
hack strictness: add DisallowDynamicVarEnvFuncs option

Summary: Allows for finer-grained control over the non-pessimization
 of ## $f() ## (added in {D1325958}), than just ##EnableHipHopSyntax##.

Reviewed By: @ptarjan

Differential Revision: D1343665
Add PACKED_TV as a compilation option to OSS build

Summary: Some diffs and PRs are failing when built with PACKED_TV. Let's see if we can build with PACKED_TV so people can do testing in open source land.

Reviewed By: @ptarjan

Differential Revision: D1343574
Tell hhbbc about collection methods that return this

Summary: This can let us capture chains of jonx like

  $v = $vector->add(1)->add(2)->add('jonx');

This change lets us statically bind each of those calls.

Reviewed By: @jdelong

Differential Revision: D1339893
Use the transports address for ServerIP

Summary: When generating the X-FB-Debug header, use the transports local
address as this will be correct for IPv4 or IPv6.  One difference here
is that we can now return 127.0.0.1 or ::1, but this matches apache.

Reviewed By: @markw65

Differential Revision: D1340583
Fix iconv extension so it will compile

Summary: Instead of including stdint.h, #ifndef INT32_MAX. It now compiles in OSS land.

Reviewed By: @ptarjan

Differential Revision: D1342769
EZC: Fix hashtables and resources

Summary: Closes #2446

As usual, the size of the pull request is determined by the amount of work it took to get the tests to pass. I considered attempting to split the hash work and the resource work into separate PRs, but the hash work is pretty badly broken without the resource work.

Allow zend_hash_*() to store non-zval data:

Call the supplied destructor when the arbitrary data is freed. This is implemented by wrapping the data in a resource -- this was a more elegant hook into HphpArray than aggressive patching or replacement of handlers.
Introduce a set of non-static methods to ProxyArray which provide wrapping and unwrapping of arbitrary data. Access them directly from zend_hash.cpp by casting ArrayData* to ProxyArray*.
Fix the handling of the pDest arguments. To support pDest efficiently, it was necessary to add an "out" parameter to the ZAppend handler, giving the index inserted.
Make Z_OBJPROP() return a ProxyArray instead of an HphpArray, per the convention that only ProxyArrays should be exposed to zend compat.
Removed unused class TypedValueHolder.
Used "using namespace HPHP" for brevity where possible.
Converted some functions that were using ArrayIter to use the integer position interface instead -- otherwise a special ArrayIter subclass would have been needed to do the ZendCustomElement unwrapping.
Added a test case for hashtables, including destructor invocation, which exposed issues with resource handling as follows:
Improve resource handling:

Call resource destructors
Make s_resource_dtors not be thread-local, since it is populated by MINIT. Also make it a std::vector instead of a std::unordered_map, for obvious reasons.
Make ZendResourceData and ZendCustomElement unsweepable, since no guarantees can be made about what they will try to free in their extension-supplied destructors.
Remove two unnecessary incRefCount() calls, which caused destructors to never be called.
Also:

Added php_write() implementation, needed by the test case.

Reviewed By: @ptarjan

Differential Revision: D1336928

Pulled By: @JoelMarcey
String setSize/shrink fixes

Summary: Use shrink() instead of setSize() when there is a significant
chance of a large difference in the initial result.

Reviewed By: @markw65

Differential Revision: D1341786
Return Array()/String() instead of null_(foo)

Summary: To avoid global lookups, return Array() or String() instead of
the null_[array|string| respectively when dealing with Array or String
returns.

Reviewed By: @markw65

Differential Revision: D1343604
Make recordBCInstr less broken

Summary: It was trying to figure out where the code was by
looking at mcg->code.stubs(), which is wrong. The callsites
should always know the correct value though, so let them decide.

It turns out this is mostly dead anyway - only a handful of things
get recorded, and they're all in "a".

Closes #2712

Reviewed By: aravind

Differential Revision: D1342628
Don't try to inline if we are in pseudoMain

Reviewed By: @alexmalyshev

Differential Revision: D1343205
Adding -n CLI option to hhvm php mode

Summary: Adding -n option when --php is used in hhvm
Expected Behavior:
 When -n is used, the default config.hdf and php.ini files
 are not automagically loaded

 -c will load these files if -n is not specified, if it is,
 the -c option will only cause the specified files to load.

Reviewed By: @ptarjan

Differential Revision: D1290756
Targetting 3.2.0

Summary: 3.1.0 has been cut, trunk is now working towards 3.2

https://github.com/facebook/hhvm/commits/HHVM-3.1

Reviewed By: @JoelMarcey

Differential Revision: D1342745
Optimize away VerifyParamType of type aliases of primitive types

Summary: We know most of these from tracelet guards, so we can
optimize them away if they're persistent.

Reviewed By: @jdelong

Differential Revision: D1335987
Move getMemSize() out of the ArrayData private member-data section

Summary: We want to keep the data by itself at the end, so you can
easily tell how memory layout on these objects work.

Reviewed By: @mxw

Differential Revision: D1344706
Make ifaceofDirect more compact

Summary: All it cares about is whether or not the name exists in the map so it
can call IndexedStringMap::contains() instead of lookupDefault().

Reviewed By: @bertmaher

Differential Revision: D1340773
hphp/runtime/server/upload.cpp: fix "=" vs "==" assert typo

Summary: I caught a similar typo in a review an hour ago, so went searching
through all of fbcode for other occurrences of this type of error.

Coincidentally, I see that D1311333 has just gone in,
and it made some of the same changes I had made, but this
one still remains.

Reviewed By: @markw65

Differential Revision: D1342164
catch C-c on the client, do not crash hh_server

Summary: Thx to julien for helping finding this bug.
I should learn to use gdb on ocaml programs ... Shame on me.

Reviewed By: jcreed

Differential Revision: D1343318
reflection: interfaces implement themselves

Summary: ... this time accounting for non-canonical spellings of the
 interface name. Actually fixes #2716.

Reviewed By: @ptarjan

Differential Revision: D1343793
Convert ext/memcached to HNI

Summary: Part of #1480
Closes #2421

Reviewed By: @ptarjan

Differential Revision: D1339030

Pulled By: @JoelMarcey