Skip to content

Commit 279ffbf

Browse files
committed
Reapply the change to allow to set the composer binary path
This change was somehow changed back during the renaming of the file I think. So this is just restoring the change.
1 parent 0b7c5b6 commit 279ffbf

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

bin/simple-phpunit.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,14 @@
150150
putenv('SYMFONY_DEPRECATIONS_HELPER=disabled');
151151
}
152152

153-
$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar')
154-
|| ($COMPOSER = rtrim((string) ('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar 2> NUL`) : `which composer.phar 2> /dev/null`)))
155-
|| ($COMPOSER = rtrim((string) ('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer 2> NUL`) : `which composer 2> /dev/null`)))
156-
|| file_exists($COMPOSER = rtrim((string) ('\\' === \DIRECTORY_SEPARATOR ? `git rev-parse --show-toplevel 2> NUL` : `git rev-parse --show-toplevel 2> /dev/null`)).\DIRECTORY_SEPARATOR.'composer.phar')
157-
? ('#!/usr/bin/env php' === file_get_contents($COMPOSER, false, null, 0, 18) ? $PHP : '').' '.escapeshellarg($COMPOSER) // detect shell wrappers by looking at the shebang
158-
: 'composer';
153+
if (false === $COMPOSER = getenv('COMPOSER_BINARY')) {
154+
$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar')
155+
|| ($COMPOSER = rtrim((string) ('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar 2> NUL`) : `which composer.phar 2> /dev/null`)))
156+
|| ($COMPOSER = rtrim((string) ('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer 2> NUL`) : `which composer 2> /dev/null`)))
157+
|| file_exists($COMPOSER = rtrim((string) ('\\' === \DIRECTORY_SEPARATOR ? `git rev-parse --show-toplevel 2> NUL` : `git rev-parse --show-toplevel 2> /dev/null`)).\DIRECTORY_SEPARATOR.'composer.phar')
158+
? ('#!/usr/bin/env php' === file_get_contents($COMPOSER, false, null, 0, 18) ? $PHP : '').' '.escapeshellarg($COMPOSER) // detect shell wrappers by looking at the shebang
159+
: 'composer';
160+
}
159161

160162
$prevCacheDir = getenv('COMPOSER_CACHE_DIR');
161163
if ($prevCacheDir) {

0 commit comments

Comments
 (0)