facebook/hhvm — pull request #2510 by dumbbell (2014-04-22 15:00:35+00:00)
Title: FastCGI: Use SCRIPT_FILENAME as the PHP script to run

The goal is to fix the issue #1938.

As discussed in this issue, I propose to add a method `getScriptFilename()` to the `Transport` class. In the FastCGI case, this returns the value of `SCRIPT_FILENAME`, which was provided by the webserver. This fixes a bug where `PATH_TRANSLATED` is meaningless (in HHVM's point of view) if the URL contains a `PATH_INFO`.

While here, the code now makes sure `$_SERVER['DOCUMENT_ROOT']` doesn't end with a `/`.

I checked against all combinations of Apache or Yaws as the webserver, and php-fpm or HHVM as the PHP interpreter. In all cases, the values of `$_SERVER['DOCUMENT_ROOT']`, `$_SERVER['SCRIPT_NAME']`, `$_SERVER['SCRIPT_FILENAME']`, `$_SERVER['PATH_INFO']` and `$_SERVER['PATH_TRANSLATED']` were the same.