Fixes "false" hashbang interpretation

- Lexer now only interprets "#!" as a line-1-hashbang
- Added tests for a leading line with both "#test" and a real hash-bang
like "#!hashbang"

Closes #1396
Closes #1465

Reviewed By: @ptarjan

Differential Revision: D1114361

Pulled By: @scannell
fix stream_get_contents without specified offset

File does its own internal buffering and uses m_readpos, m_writepos,
m_position for the purpose of keeping track of file offsets. This means
that current (PHP) position is not in sync with the underlying file
descriptor (m_fd).

This works fine, were it not for the fact that ext_stream calls directly
into pure virtual method readImpl that generally lives in PlainFile
and works directly on the file descriptor that might contain an
invalid (buffered-ahead) position.

This pull request does several things:
- Remove default value 0 for File::read(int64_t length), since that
  implementation returns earlier for 0 values anyway.
- Implement an overloaded method File::read() that reads the remainder
  of the file (until EOF) by using proper File::m_* properties.
- Make ext_stream call into File::read instead of PlainFile::readImpl.

Closes #1333

Reviewed By: @ptarjan

Differential Revision: D1091550

Pulled By: @scannell
Allow indirect calls via emitCall with CppCall support

Extend CppCall to support a call indirect (via register) style and implement a call to a Variant destructor via the indirect call instead of helper

Reviewed By: @ottoni

Differential Revision: D1090464
Remove dead code in checkTmpsSpanningCalls()

Left over from the recent rewrite.

Reviewed By: @scannell

Differential Revision: D1115439
Move isConvIntOrPtrToBool close to its one use

It's a single use function so make it a lambda close to the use

Reviewed By: @jdelong

Differential Revision: D1114902
Put demangled symbols in perf map

It's easier to read perf output with demangled symbols

Reviewed By: @markw65

Differential Revision: D1114722
See if HasGeneratorAsBody is used

Sean thought maybe not since it's not clear where it's set

Reviewed By: @jano

Differential Revision: D1113304
Allow transport to override SERVER_ headers

Uses the following headers from the transport (for fastcgi)
instead of the local config if they exist:

SERVER_NAME
SERVER_ADDR
SERVER_PORT

Closes #1445

Reviewed By: @ptarjan

Differential Revision: D1114969

Pulled By: @scannell
Add more stream_wrapper functions used in Drupal

According to some users, Drupal 7 uses public:// and
temporary:// to store and move files around by using stream_wrappers.
Some functions of stream_wrappers weren't implemented. This patch adds
the following missing functions:

unlink
rename
mkdir (recursive or not)
rmdir

Closes #1474

Reviewed By: @ptarjan

Differential Revision: D1115507

Pulled By: @scannell
add interfaces to whole program (repo mode) trait flattening

anietoro added the 'trait T implements I' syntax, but not support for it in repo mode.

Reviewed By: @markw65

Differential Revision: D1111927
Fixed xmlwriter null prefix bug

HPHP was inconsistent with Zend PHP in its rendering of the XMLWriter
startElementNS method. This diff brings better consistency with Zend for the
case of null prefix string or empty prefix string.

Reviewed By: @ptarjan

Differential Revision: D1114272
fixup isDefaultValueAvailable() and isOptional() for builtins

The `Func*` doesn't keep around information about defaults from the IDL so I switched to using the `ClassInfo`. That in turn showed me there was some logic in there that wasn't being used by anything anymore (as there are no values in the IDL's with foo::bar() in them except for `TimeStamp::Current` which is clearly destined for C++). Ripping that out allowed me to kill a helper functions.

I then did the real work that I wanted and marked parameters with `internal` and don't say there is a default value for those and throw the same exception that zend does.

Reviewed By: @markw65

Differential Revision: D1054845
enable TestFastCGIProtocol

The Server tests were the flakey ones, but both got disabled. Lets leave the unit tests around so I don't break stuff.

Reviewed By: @scannell

Differential Revision: D1115879
delete FastCGIConnection object

This was a leak appearing in @apuckey's valgrind dump. @simpkins said the object should delete itself since either the success or error callbacks will for sure be called for each connection.

Closes #1252

Reviewed By: @scannell

Differential Revision: D1115399
Revert "INI parser fixes for OSS"

This is required to revert "Fixes to parse_ini_(file|string)"
cleanly.

Reviewed By: @markw65

Differential Revision: D1116195
Revert "Fixes to parse_ini_(file|string)"

This reverts commit 0d694bcf6c0fa7aa4c15f166d0732ea37c5566d8.
It's causing parse_ini_string to sometimes hit assertions in
StringData::setSize, and behavior issues on the intern tier.  The fix
wasn't completely obvious and there's an open diff relating to
relevant cases (escaped double quotes), so let's just revert until it
can be looked at by emil.

Reviewed By: @markw65

Differential Revision: D1116199
Add a unit test that aborts with recent ini changes

So that we can test this case before adding it back.

Reviewed By: @ptarjan

Differential Revision: D1116203
emit fatal bytecodes from errors found during trait flattening

An overtly literal person might suspect that ##Compiler::Error## would
involve a compiler spitting out an error message reflected in the
ensuing code. Instead, it turns out that it records the message in a
separate area and blithely **continues onwards** as if the error never
occurred.

In repo mode, traits are imported in the compiler as opposed to at
Class initiation time. My contention is that any fatals/errors
discored during trait flattening should be available at runtime when
an attempt is made to load the file.

This diff introduces the notion of an `AnalysisTimeFatal` to the
compiler and ensures that this fatal propagates (with [analysis] added
to the fatal message). It also ensures that trait flattening and
non-repo trait import share the same error messages, which should make
it possible to eventually stop producing ##.expectf## files that
contain the almost entirely inscrutable ##HPHP Fatal Error: %s##.

Reviewed By: @markw65

Differential Revision: D1112629
Fix bad_ini_quotes test

Oops.

Reviewed By: @ptarjan

Differential Revision: D1116602
re-enable ftp_chmod_basic

The other ftp tests have ben fine since I fixed the port choosing issue upstream.

Reviewed By: @jdelong

Differential Revision: D1116504