8000 bug #25304 [Bridge/PhpUnit] Prefer $_SERVER['argv'] over $argv (ricknox) · symfony/symfony@31e4533 · GitHub
[go: up one dir, main page]

Skip to content

Commit 31e4533

Browse files
committed
bug #25304 [Bridge/PhpUnit] Prefer $_SERVER['argv'] over $argv (ricknox)
This PR was submitted for the master branch but it was squashed and merged into the 3.3 branch instead (closes #25304). Discussion ---------- [Bridge/PhpUnit] Prefer $_SERVER['argv'] over $argv | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a This makes the script usable even if it is wrapped into another script, which is what some IDEs like PHPStorm do. Commits ------- 1ff22e6 [Bridge/PhpUnit] Prefer ['argv'] over
2 parents 1f2213a + 1ff22e6 commit 31e4533

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ EOPHP
108108

109109
}
110110

111+
global $argv, $argc;
112+
$argv = isset($_SERVER['argv']) ? $_SERVER['argv'] : array();
113+
$argc = isset($_SERVER['argc']) ? $_SERVER['argc'] : 0;
111114
$components = array();
112115
$cmd = array_map('escapeshellarg', $argv);
113116
$exit = 0;

0 commit comments

Comments
 (0)
0