Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e1c843

Browse files
committed
When using phpenv + phpenv-composer plugin, composer executable is wrapped into bash script, checking that detected composer has shebang
1 parent 4b419f2 commit 0e1c843

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ foreach ($defaultEnvs as $envName => $envValue) {
5757
}
5858
}
5959

60-
$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar')
60+
$COMPOSER =
61+
file_exists($COMPOSER = $oldPwd.'/composer.phar')
6162
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
6263
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer`) : `which composer 2> /dev/null`))
63-
? $PHP.' '.escapeshellarg($COMPOSER)
64+
? (!'\\' === DIRECTORY_SEPARATOR && (fread($fp = fopen($COMPOSER, 'rb'), 2) === '#!' && fclose($fp)) ? '' : $PHP).' '.escapeshellarg($COMPOSER) // checking that detected COMPOSER has shebang at the start, if it's found do not append php-executable
6465
: 'composer';
6566

6667
if (false === $SYMFONY_PHPUNIT_REMOVE = getenv('SYMFONY_PHPUNIT_REMOVE')) {

0 commit comments

Comments
 (0)