Implemented xdebug profiling

Summary: Collecting profiling was implemented in D1423763, enabling/disabling it was
implemented in D1438290, this implements writing the collected profiling info
to a cachegrind compatible file.

The cachegrind file (at least the xdebug version) describes function calls,
function call files, function call time, and function call line #'s.

Programs that read this format (such as kcachegrind, qcachegrind, etc) can
use the generated files to get pretty graphs:
https://www.facebook.com/pxlcld/lqww
https://www.facebook.com/pxlcld/lqwz

One major difference between php5 xdebug and this is that only certain builtin
functions will be collected by the profiler. This is very unfortunate as
profiling builtin function calls would definitely be useful to the user, but
there isn't an obvious fix to this. The profilers plug into
the runtime via event hooks, which are not called for builtin function begin/end
events. Adding this wouldn't be simple because the event hook function begin/end
methods assume an ActRec is generated, which is not true for builtins.
Depends on D1438290.

Reviewed By: @ptarjan

Differential Revision: D1448800
Allow debugger to attach to more classes of requests

Summary: Specifically any request sent with a document root never had
its sandbox setup.  This patch feels like a bit of a hack, but with
just these two lines i can attach to and debug live fcgi request
that i could not without it.

Closes https://github.com/facebook/hhvm/pull/3276

Reviewed By: @ptarjan

Differential Revision: D1457845

Pulled By: svcscm
OS X fixes

Summary: These commits allow compiling HHVM on OS X 10.9 with its native clang compiler.

This also requires https://github.com/facebook/hhvm/pull/3159, https://github.com/facebook/folly/issues/75 and https://github.com/hhvm/hhvm-third-party/issues/18.

CMake config:
```bash
cmake .. \
    -DLIBIBERTY_LIB=$(brew --prefix binutilsfb)/lib/x86_64/libiberty.a \
    -DLIBEVENT_LIB=$(brew --prefix libevent)/lib/libevent.dylib \
    -DLIBEVENT_INCLUDE_DIR=$(brew --prefix libevent)/include \
    -DICU_INCLUDE_DIR=$(brew --prefix icu4c)/include \
    -DICU_LIBRARY=$(brew --prefix icu4c)/lib/libicuuc.dylib \
    -DICU_I18N_LIBRARY=$(brew --prefix icu4c)/lib/libicui18n.dylib \
    -DICU_DATA_LIBRARY=$(brew --prefix icu4c)/lib/libicudata.dylib \
    -DREADLINE_INCLUDE_DIR=$(brew --prefix readline)/include \
    -DREADLINE_LIBRARY=$(brew --prefix readline)/lib/libreadline.dylib \
    -DCURL_INCLUDE_DIR=$(brew --prefix curl)/include \
    -DCURL_LIBRARY=$(brew --prefix curl)/lib/libcurl.dylib \
    -DBOOST_INCLUDE

Closes https://github.com/facebook/hhvm/pull/3182

Reviewed By: @ptarjan

Differential Revision: D1432897

Pulled By: svcscm
Remove unused return type from jmpcond helpers

Summary: That's it.

Reviewed By: @ottoni

Differential Revision: D1457867
Update some HHI files

Summary: Could really do with a false-able type ;)

Closes https://github.com/facebook/hhvm/pull/3283

Reviewed By: @JoelMarcey

Differential Revision: D1460376

Pulled By: svcscm
Changed CRYPT_BLOWFISH to 1 because apparently it is available

Summary: CRYPT_BLOWFISH is set to 0 in HHVM. PHP's documentation states that it is set to 1 where blowfish is available in `crypt`.

Blowfish support is available in HHVM since 4a23fdc0dc804c9a5fa8bc84f9016c1d44597afb so the constant should be set to 1.

Fixes #3274

Closes https://github.com/facebook/hhvm/pull/3284

Reviewed By: @JoelMarcey

Differential Revision: D1460377

Pulled By: svcscm
Add sort_flags to ArrayObject::asort

Summary: PHP's documentation doesn't say anything about this. But they test against it and it works.

Closes https://github.com/facebook/hhvm/pull/3278

Reviewed By: @ptarjan

Differential Revision: D1458888

Pulled By: svcscm
Put msarray/miarray warnings behind a runtime option

Reviewed By: @edwinsmith

Differential Revision: D1447713
class requirements: raise error if missing lookupClass

Summary: ... a bit more error resilient on the *second* use of a class with a missing requirement.

Reviewed By: @jdelong

Differential Revision: D1440884
Rename snappy methods

Summary: Renames sncompress to snappy_compress and snuncompress to snappy_uncompress to maintain code compatibility with PHP (when using php-snappy):

https://code.google.com/p/php-snappy/

Fixes compatibility specifically with:
https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/blob/master/Cm/Cache/Backend/Redis.php#L857

Replaces old PR due to incorrect commit message

Closes https://github.com/facebook/hhvm/pull/3259

Reviewed By: ptarjan, joelm

Differential Revision: D1452331

Pulled By: svcscm
Implemented basic xdebug tracing

Summary: This diff implements xdebug tracing, but does not include support for
outputting HTML or computerized tracing formats. Those will come next.

Xdebug tracing is a feature that, after started, collects information
about function begin/end events and then writes the information to
a nicely formatted file. It can be started and stopped on demand.

An example is below:
    TRACE START [2014-07-25 04:21:58]
        0.0079     248240      +32       -> var_dump() /home/jlreyes/tests/xdebug_tracing/trace.php:4
        0.0080     248192      -48     -> xdebug_get_tracefile_name() /home/jlreyes/tests/xdebug_tracing/trace.php:7
        0.0080     248272      +80     -> var_dump() /home/jlreyes/tests/xdebug_tracing/trace.php:7
        0.0087     249792    +1520     -> require(/home/jlreyes/tests/xdebug_tracing/trace_helper.php) /home/jlreyes/tests/xdebug_tracing/trace.php:8
        0.0087     249792       +0       -> bee() /home/jlreyes/tests/xdebug_tracing/trace_helper.php:7
        0.0087     249160     -632     -> Foo->bar() /home/jlreyes/tests/xdebug_tracing/trace.php:25
        0.0088     249208      +48       -> Foo->bar() /home/jlreyes/tests/xdebug_tracing/trace.php:13
        0.0088     249256      +48         -> Foo->bar() /home/jlreyes/tests/xdebug_tracing/trace.php:13
        0.0088     249304      +48           -> Foo->bar() /home/jlreyes/tests/xdebug_tracing/trace.php:13
        0.0088     249344      +40             -> baz() /home/jlreyes/tests/xdebug_tracing/trace.php:12
        0.0089     249344       +0               -> boo() /home/jlreyes/tests/xdebug_tracing/trace.php:18
        0.0089     249344       +0               -> boo() /home/jlreyes/tests/xdebug_tracing/trace.php:18
        0.0089     249344       +0               -> boo() /home/jlreyes/tests/xdebug_tracing/trace.php:19
        0.0090     249056     -288     -> boo() /home/jlreyes/tests/xdebug_tracing/trace.php:26
        0.0090     249056       +0     -> bee() /home/jlreyes/tests/xdebug_tracing/trace.php:27
        0.0090     249104      +48     -> xdebug_stop_trace() /home/jlreyes/tests/xdebug_tracing/trace.php:29
        0.0090     249136
    TRACE END   [2014-07-25 04:21:58]

There are several small consistency changes that are included in this
diff, such as ensuring variables related to the frame buffer are the
same type (int64_t).

Reviewed By: @ptarjan

Differential Revision: D1457916
typo

Summary: Closes https://github.com/facebook/hhvm/pull/3287

Reviewed By: @JoelMarcey

Differential Revision: D1460695

Pulled By: svcscm
fix parser with bison 3

Reviewed By: @Jo-Con-El

Differential Revision: D1460649
Fix IntlDateFormatter memory leak

Summary: IntlDateFormatter::setDateFormatter leaks TimeZone objects, as the TZ
returned from IntlTimeZone::ParseArg is cloned by icu::DateFormat, not
adopted.

Closes https://github.com/facebook/hhvm/pull/3286

Reviewed By: @ptarjan

Differential Revision: D1460696

Pulled By: svcscm
Support stream wrappers in XML parser extensions, add external entity loader

Summary:
* Support stream wrappers in SimpleXML, DOM and XMLReader input and
  output filenames.
* Rename libxml_input_buffer() to libxml_create_input_buffer().
* Implement userspace function libxml_set_streams_context(), was
  previously missing.
* Since the VM can now be re-entered during parsing, with libxml2 in the
  call stack with -fomit-frame-pointer, all XML parsing functions must
  be protected with SYNC_VM_REGS_SCOPED().
* In DOMDocument, don't do File::TranslatePath() on input filenames,
  since they can now be URLs, and translation is now redundant with that
  done by FileStreamWrapper.
* In simplexml_load_file(), call xmlReadFile() instead of
  f_file_get_contents(), so that the libxml default stream context is
  used. Almost fixes test/zend/bad/ext/libxml/tests/bug54440.php, except
  for a minor error handling issue that should be dealt with by GitHub
  PR #2376.
* In stream_context_create(), return a default stream context resource
  when the options fail validation, instead of returning false. This
  matches the PHP behaviour and makes
  hphp/test/zend/bad/ext/libxml/tests/bug63389.php pass.
* Move passing tests to hphp/test/zend/good
* Add test.xml, copied from PHP 5.6.0-dev, needed by a passing test.
* Add an external entity loader. This allows the use of "data:" and
  "compress.zlib:" in entities and URIs.

Since loading external entities exposes a number of security issues including
remote shell execution, it's disabled by default (except for the data: protocol
which isn't actually external). The new config option is documented in
doc/inconsistencies.

Submitted on behalf of a third-party: The PHP Group
Source: PHP 5.6.0-dev
License: version 3.01 of the PHP license

Closes: #2329
Closes: #2829

Test Plan: automated tests, new version of zend test to make sure external
entity loading fails by default