From 4bedd8379a5cc3e9e3e02b31ec70d1279a2b7bc4 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 9 Mar 2021 13:57:41 +0100 Subject: [PATCH] Fix php-proxying of binaries to avoid proxying phar files, fixes #9742 --- src/Composer/Installer/BinaryInstaller.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Composer/Installer/BinaryInstaller.php b/src/Composer/Installer/BinaryInstaller.php index 3ffbb50b3..47022ff42 100644 --- a/src/Composer/Installer/BinaryInstaller.php +++ b/src/Composer/Installer/BinaryInstaller.php @@ -192,14 +192,18 @@ class BinaryInstaller $binFile = basename($binPath); $binContents = file_get_contents($bin); + // For php files, we generate a PHP proxy instead of a shell one, + // which allows calling the proxy with a custom php process if (preg_match('{^(?:#!(?:/usr)?/bin/env php|#!(?:/usr)?/bin/php|