minor #21148 [PhpUnitBridge] Fix HHVM compat with putenv() (nicolas-grekas)
This PR was merged into the 3.2 branch.
Discussion
----------
[PhpUnitBridge] Fix HHVM compat with putenv()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
On HHVM, `putenv()` is ignored by `passthru()` & co., but works with `proc_open()`.
Commits
-------
d4553c5
[PhpUnitBridge] Fix HHVM compat with putenv()
This commit is contained in:
commit
c29f89515d
@ -50,12 +50,12 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
|
|||||||
chdir("phpunit-$PHPUNIT_VERSION");
|
chdir("phpunit-$PHPUNIT_VERSION");
|
||||||
$prevRoot = getenv('COMPOSER_ROOT_VERSION');
|
$prevRoot = getenv('COMPOSER_ROOT_VERSION');
|
||||||
putenv("COMPOSER_ROOT_VERSION=$PHPUNIT_VERSION");
|
putenv("COMPOSER_ROOT_VERSION=$PHPUNIT_VERSION");
|
||||||
passthru("$COMPOSER remove --no-update ".(getenv('SYMFONY_PHPUNIT_REMOVE') ?: 'phpspec/prophecy symfony/yaml'));
|
proc_close(proc_open("$COMPOSER remove --no-update ".(getenv('SYMFONY_PHPUNIT_REMOVE') ?: 'phpspec/prophecy symfony/yaml'), array(), $p));
|
||||||
if (5.1 <= $PHPUNIT_VERSION && $PHPUNIT_VERSION < 5.4) {
|
if (5.1 <= $PHPUNIT_VERSION && $PHPUNIT_VERSION < 5.4) {
|
||||||
passthru("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
|
passthru("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
|
||||||
}
|
}
|
||||||
passthru("$COMPOSER require --no-update symfony/phpunit-bridge \">=3.2@dev\"");
|
proc_close(proc_open("$COMPOSER require --no-update symfony/phpunit-bridge \">=3.2@dev\"", array(), $p));
|
||||||
passthru("$COMPOSER install --no-dev --prefer-dist --no-progress --ansi", $exit);
|
$exit = proc_close(proc_open("$COMPOSER install --no-dev --prefer-dist --no-progress --ansi", array(), $p));
|
||||||
putenv('COMPOSER_ROOT_VERSION'.(false !== $prevRoot ? '='.$prevRoot : ''));
|
putenv('COMPOSER_ROOT_VERSION'.(false !== $prevRoot ? '='.$prevRoot : ''));
|
||||||
if ($exit) {
|
if ($exit) {
|
||||||
exit($exit);
|
exit($exit);
|
||||||
|
Reference in New Issue
Block a user