Backport depth limit into ext_xml.cpp

Limit XML tree depth (backport of PHP bug #65236 / CVE-2013-4113). Upstream commit: http://git.php.net/?p=php-src.git;a=commit;h=7d163e8a0880ae8af2dd869071393e5dc07ef271

The upstream fix is a bit weird; the return value indicates success even though the tree was truncated. This diff replicates this behavior.

Reviewed By: @bertmaher

Differential Revision: D1212028
Fix hhvm --php -d - bad temporary filename, parsed as hdf

- breaks phpunit @Alite404Exception
 - '-c' and filename need to be two args - this was interpreted as adding an extra space, leading to file not found
 - temporary ones don't end in .ini

refs facebook/hhvm#1904

Reviewed By: @ptarjan

Differential Revision: D1224939
add a few funtions to the language

These are functions that are baked into the typechecker to help express things that we don't have syntax for. E.g. we can't annotate a function that guarantees its first parameter is true after it has executed, so we need `invariant`, etc.

Reviewed By: @jwatzman

Differential Revision: D1210453
Disable jit on OSX by default

It doesn't work anyway :)

Reviewed By: @ptarjan

Differential Revision: D1228970
Rename fb_autoload_map to HH\autoload_set_paths

- not FB-only
- very useful
- Renamed to fit in better with php5 autoload functions
- Don't have 'map' in the name given that it takes an array, not an HH\Map

Reviewed By: @ptarjan

Differential Revision: D1229244
apply ini settings before we use them

Reviewed By: @fredemmott

Differential Revision: D1228470
make hhvm.server.file_socket

This needs to be settable by an INI

Reviewed By: @fredemmott

Differential Revision: D1228616
serve hh files as php files

Why on earth we have this check I have no idea. In fastcgi at least it makes no sense.

Reviewed By: @jdelong

Differential Revision: D1228632
Fix precedence for == with DateTimeInterface implementations

Reviewed By: @alexmalyshev

Differential Revision: D1230275
Guard against integer overflows in various string functions.

Introduce a overflow-checking function to fix the following functions:
  - escapeshellarg
  - escapeshellcmd
  - urlencode

A more involved backport was done to quoted_printable_encode. There were several bugfixes to this function in upstream PHP, I just duplicated the code here but made it use std::string.

Reviewed By: @bertmaher

Differential Revision: D1217432
Config files: lean towards parsing something as an hdf instead of an ini

FB compatibility. Temporary, as we want to completely kill hdf files

Reviewed By: @jdelong

Differential Revision: D1234052
support hhvm.eval.jit ini option

I want to be able to suggest to people to set this in their `php.ini` file so that they can make command line scripts fast

Reviewed By: @fredemmott

Differential Revision: D1233579
better lack-of-libevent message

we are going to stop bundling the libevent server and it is confusing lots of people. I hope this makes it more easy to understand what is broken.

Reviewed By: @fredemmott

Differential Revision: D1233597
Tweak hdf vs ini heuristic

In general, assuming something is an ini file is the right thing to do, given OSS compatibility and the planned deprecation of ini files

This fixes some php5 test failures which have a '.tmp' ini file.

Reviewed By: @edwinsmith

Differential Revision: D1239110
Fix several issues with array type inference

If an array was non-empty, ensure_counted would add BCArrE to
bits (via using BCArr), which can break index invariants (types aren't
allowed to grow between rounds, but this could accidentally add
emptiness to non-empty arrays).  Also, set of new keys in struct-like
arrays were inserting the values as TTop due to a bug in the logic for
set(), which was hiding a bug in final BindM operations.  Aside from
the BindM issue, I /think/ none of these should've caused incorrect
code---they just break the rules about what you can do to the index on
each iteration.

Reviewed By: @edwinsmith

Differential Revision: D1237338
add fun.ns.php

This file got lost in a merge conflict somehwere
Ignore hphp/hack/Makefile
Stop setting global variables, it can conflict with other plugins

Specifically is *does* conflict with YouCompleteMe that imports it's own `base` module. Python support in vim is buggy, but this is an easy fix.
Closes #2117
Github Author: James Miller <jamespocketrent.com>

Reviewed By: @toroman

Differential Revision: D1232398
Update HHI files

Adds the differenceByKey() signature, corrects the toImmMap() return type.

Adds the SleepWaitHandle and SessionScopedWaitHandle classes.
Closes #2112
Github Author: Simon Welsh <simonsimon.geek.nz>

Reviewed By: @elgenie

Differential Revision: D1232083
support for Stringish

Typechecker counterpart to {D1214064}: Stringish is
 implemented implicitly by any object with a __toString, and also has
 "string"s as a subtype

Reviewed By: @jwatzman

Differential Revision: D1215427