[PHPUnitBridge] Fixed crash on Windows with PHP 8

The install command crashed with the message
"The filename, directory name, or volume label syntax is incorrect.".
It happens only on Windows with PHP 8.

Probably due to https://github.com/php/php-src/blob/PHP-8.0/UPGRADING#L1121-L1123
This commit is contained in:
Fabien Villepinte 2020-10-31 13:49:56 +00:00
parent d71c404a9f
commit 4b958917fd
1 changed files with 1 additions and 1 deletions

View File

@ -231,7 +231,7 @@ if (!file_exists("$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR/phpunit") || $configurationH
}
$prevRoot = getenv('COMPOSER_ROOT_VERSION');
putenv("COMPOSER_ROOT_VERSION=$PHPUNIT_VERSION.99");
$q = '\\' === \DIRECTORY_SEPARATOR ? '"' : '';
$q = '\\' === \DIRECTORY_SEPARATOR && \PHP_VERSION_ID < 80000 ? '"' : '';
// --no-suggest is not in the list to keep compat with composer 1.0, which is shipped with Ubuntu 16.04LTS
$exit = proc_close(proc_open("$q$COMPOSER install --no-dev --prefer-dist --no-progress $q", [], $p, getcwd()));
putenv('COMPOSER_ROOT_VERSION'.(false !== $prevRoot ? '='.$prevRoot : ''));