diff --git a/src/Composer/Installer/BinaryInstaller.php b/src/Composer/Installer/BinaryInstaller.php index 43254af61..91479bf58 100644 --- a/src/Composer/Installer/BinaryInstaller.php +++ b/src/Composer/Installer/BinaryInstaller.php @@ -359,6 +359,11 @@ namespace Composer; $globalsCode $streamProxyCode + +if (__FILE__ === realpath(\$_SERVER['SCRIPT_NAME'])) { + \$_SERVER['SCRIPT_NAME'] = realpath($binPathExported); +} + return include $binPathExported; PROXY; diff --git a/tests/Composer/Test/Installer/BinaryInstallerTest.php b/tests/Composer/Test/Installer/BinaryInstallerTest.php index 8b6d47243..0fe971793 100644 --- a/tests/Composer/Test/Installer/BinaryInstallerTest.php +++ b/tests/Composer/Test/Installer/BinaryInstallerTest.php @@ -110,6 +110,18 @@ EOL [<<<'EOL' +