Convert ext/curl to HNI

Convert ext/curl to HNI

Closes #1692

Reviewed By: @sgolemon

Differential Revision: D1155575

Pulled By: @scannell
Some fixes and move a bunch of tests that now passes

- Support persistant connections
- Small bug fix when calling data_seek and not having a result

Reviewed By: @ptarjan

Differential Revision: D1160110
Case-insensitive check for Accept-Encoding: gzip

We were using case-sensitive std::string::find for this. Use strcasestr
instead.

Reviewed By: @markw65

Differential Revision: D1164176
Fix bogus namespace error.

Don't bail out with an error if a hashbang precedes a namespace declaration
in a source file.

Reviewed By: @ptarjan

Differential Revision: D1160029
tcache.flush mallctl was renamed in jemalloc3, update

Since upgrading to jemalloc3 hhvm hasn't actually been flushing
the tcache during idle times.  That bug has also been masking a bug in
which we still try to purge thread.arena despite overriding jemalloc
narenas to be 1, so I have removed that code as well.

Reviewed By: @jasone

Differential Revision: D1157139
Fix Travis test errors

- Fix 2 tests by not using table test
- Move 1 test to bad until I figure out why it fails on travis

Reviewed By: @scannell

Differential Revision: D1164756
Fix typo in ext_mysqli.php

$opions -> $option

Reviewed By: @JoelMarcey

Differential Revision: D1158079
TypeAnnotation support for "Num" typehint.

Treat `Num` as a variant since we don't know
whether or not it'll be float or int.

Reviewed By: @scannell

Differential Revision: D1151399
Fix libzip to check zip archive members pointer before freeing.

This is a patch for #1754. The actual fix is already in the master
branch of the source library:
http://hg.nih.at/libzip/comparison/8cc36648e0a2/lib/zip_fclose.c
Temporarily use fredemmott branch of Laravel

Not yet merged, ongoing discussion about which branch it should be merged into

Reviewed By: @JoelMarcey

Differential Revision: D1165257
Fixes for Code Model for query expressions.

The serialization code for query expressions did not match the actual code model in a various places. Also, the model for into expressions was incorrect. Also changed the way that order by AST nodes are constructed because the tokens for ascending and descending always report 0 as their token id value.

Reviewed By: @paroski

Differential Revision: D1157921
More mysqli fixes

- When calling mysqli->prepare() and the statement failed for some reason move the errors from the statement object to the mysqli object
- Remove typing for real_escape_string and friends. In the end they all call mysql_real_escape_string which will handle the typing

Reviewed By: @ptarjan

Differential Revision: D1162521
stop making that dumb dump.txt

The `.skipif` files turned out to be making it. Great.

Reviewed By: @scannell

Differential Revision: D1162446
Fastcgi execution file implementation fixes

Make the fastcgi implementation more robust in detecting the
filename to execute.
Support for files outside of document root.
Removed Duplicate CopyPathInfo so it only does this once.

Closes #1702
Closes #1708

Reviewed By: @scannell

Differential Revision: D1159825

Pulled By: @ptarjan
Correctly handle invalidated POST data on upload path

DecodeRfc1867 was returning a data and length pointer that were being copied and saved for use with php://input.  In the case where AlwaysPopulateRawPostData is false, data will actually point to the last chunk received, but size will be the cumulative size of the post.  There's nothing meaningful that can be done with this data, just ignore it.

The data copy immediately prior to DecodeRfc1867 was unecessary when AlwaysPopulate was off, but for a silly realloc call in read_post.  Reworked this case to avoid the realloc/memcpy and just read directly from the network buffer.  While I was there, I corrected some integer types that could cause problems for POSTs > 2GB.

Reviewed By: @ptarjan

Differential Revision: D1164497
Add control of number of threads and running like PHPUnit

Add two options:

1. To specify the number of threads the runner should use run running a set
of framework tests.

2. To allow one to specify that framework tests should be run just like they
would be with normal PHPUnit. This has the effect, essentially, of setting
the Framework $parallel member to false at the command line. This setting
could cause the testing to stop in its tracks with a fatal, just like
PHPUnit stops too.

Pear actually is --as-phpunit by default (with the override of $parallel = false)
in its constructor, because it breaks otherwise.

Reviewed By: @ptarjan

Differential Revision: D1165221
Remove unused IR instructions StMemNT and StPropNT

They aren't used.

Reviewed By: @jdelong

Differential Revision: D1165571
StMem sometimes is used to store to RefData, don't allow SIMD.

Storing a 16-byte SIMD register to a RefData clobbers the
RefData's refcount field.

Reviewed By: @ottoni

Differential Revision: D1164200
Bump assetic to latest master

Release branch tests fail in Zend too.

Reviewed By: @JoelMarcey

Differential Revision: D1165620
Do not crash in mysql function if result is freed and used again

- If res->get() is NULL we need to return NULL
- Used here for example diffusion/FBCODE/browse/master/hphp/runtime/ext/mysql/ext_mysql.cpp;d2a96349bfb09871$750
- Then diffusion/FBCODE/browse/master/hphp/runtime/ext/mysql/ext_mysql.cpp;d2a96349bfb09871$761-762 we get the MYSQL_RES and call mysql_num_rows but if MYSQL_RES is null that crash.

Reviewed By: @ptarjan

Differential Revision: D1165390