8000 bug #20862 Allow simple-phpunit to be used with an HTTP proxy (Cydonia7) · symfony/symfony@126c7ff · GitHub
[go: up one dir, main page]

Skip to content

Commit 126c7ff

Browse files
committed
bug #20862 Allow simple-phpunit to be used with an HTTP proxy (Cydonia7)
This PR was merged into the 3.2 branch. Discussion ---------- Allow simple-phpunit to be used with an HTTP proxy | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | no The title pretty much sums it up. I had to use the script behind a proxy and it did not work well so here is a little fix to take the `http_proxy` environment variable into account when downloading with fopen. I don't think there needs to be a doc PR associated since this feature should be transparent for the end-user. Commits ------- 921b646 Allow simple-phpunit to be used with an HTTP proxy
2 parents 8e19e2c + 921b646 commit 126c7ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
3737
if (file_exists("phpunit-$PHPUNIT_VERSION")) {
3838
passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? '(del /S /F /Q %s & rmdir %1$s) >nul': 'rm -rf %s', "phpunit-$PHPUNIT_VERSION"));
3939
}
40-
if (extension_loaded('openssl') && ini_get('allow_url_fopen')) {
40+
if (extension_loaded('openssl') && ini_get('allow_url_fopen') && !isset($_SERVER['http_proxy']) && !isset($_SERVER['https_proxy'])) {
4141
stream_copy_to_stream(fopen("https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip", 'rb'), fopen("$PHPUNIT_VERSION.zip", 'wb'));
4242
} else {
4343
@unlink("$PHPUNIT_VERSION.zip");

0 commit comments

Comments
 (0)
0