Skip to content

Commit 0b83e8a

Browse files
committed
[PhpUnitBridge] Use COMPOSER_BINARY env var if available
1 parent dfa1b61 commit 0b83e8a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

bin/simple-phpunit

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ foreach ($defaultEnvs as $envName => $envValue) {
6565
}
6666
}
6767

68-
$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar')
69-
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
70-
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer`) : `which composer 2> /dev/null`))
71-
? (file_get_contents($COMPOSER, false, null, 0, 18) === '#!/usr/bin/env php' ? $PHP : '').' '.escapeshellarg($COMPOSER) // detect shell wrappers by looking at the shebang
72-
: 'composer';
68+
if (false === $COMPOSER = \getenv('COMPOSER_BINARY')) {
69+
$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar')
70+
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
71+
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer`) : `which composer 2> /dev/null`))
72+
? (file_get_contents($COMPOSER, false, null, 0, 18) === '#!/usr/bin/env php' ? $PHP : '').' '.escapeshellarg($COMPOSER) // detect shell wrappers by looking at the shebang
73+
: 'composer';
74+
}
7375

7476
if (false === $SYMFONY_PHPUNIT_REMOVE = getenv('SYMFONY_PHPUNIT_REMOVE')) {
7577
$SYMFONY_PHPUNIT_REMOVE = 'phpspec/prophecy symfony/yaml';

0 commit comments

Comments
 (0)