[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:
parent
d71c404a9f
commit
4b958917fd
@ -231,7 +231,7 @@ if (!file_exists("$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR/phpunit") || $configurationH
|
|||||||
}
|
}
|
||||||
$prevRoot = getenv('COMPOSER_ROOT_VERSION');
|
$prevRoot = getenv('COMPOSER_ROOT_VERSION');
|
||||||
putenv("COMPOSER_ROOT_VERSION=$PHPUNIT_VERSION.99");
|
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
|
// --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()));
|
$exit = proc_close(proc_open("$q$COMPOSER install --no-dev --prefer-dist --no-progress $q", [], $p, getcwd()));
|
||||||
putenv('COMPOSER_ROOT_VERSION'.(false !== $prevRoot ? '='.$prevRoot : ''));
|
putenv('COMPOSER_ROOT_VERSION'.(false !== $prevRoot ? '='.$prevRoot : ''));
|
||||||
|
Reference in New Issue
Block a user