Skip to content

Commit c29f895

Browse files
minor symfony#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()
2 parents 4020a0d + d4553c5 commit c29f895

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
5050
chdir("phpunit-$PHPUNIT_VERSION");
5151
$prevRoot = getenv('COMPOSER_ROOT_VERSION');
5252
putenv("COMPOSER_ROOT_VERSION=$PHPUNIT_VERSION");
53-
passthru("$COMPOSER remove --no-update ".(getenv('SYMFONY_PHPUNIT_REMOVE') ?: 'phpspec/prophecy symfony/yaml'));
53+
proc_close(proc_open("$COMPOSER remove --no-update ".(getenv('SYMFONY_PHPUNIT_REMOVE') ?: 'phpspec/prophecy symfony/yaml'), array(), $p));
5454
if (5.1 <= $PHPUNIT_VERSION && $PHPUNIT_VERSION < 5.4) {
5555
passthru("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
5656
}
57-
passthru("$COMPOSER require --no-update symfony/phpunit-bridge \">=3.2@dev\"");
58-
passthru("$COMPOSER install --no-dev --prefer-dist --no-progress --ansi", $exit);
57+
proc_close(proc_open("$COMPOSER require --no-update symfony/phpunit-bridge \">=3.2@dev\"", array(), $p));
58+
$exit = proc_close(proc_open("$COMPOSER install --no-dev --prefer-dist --no-progress --ansi", array(), $p));
5959
putenv('COMPOSER_ROOT_VERSION'.(false !== $prevRoot ? '='.$prevRoot : ''));
6060
if ($exit) {
6161
exit($exit);

0 commit comments

Comments
 (0)