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
-------
1ff22e6acc
[Bridge/PhpUnit] Prefer ['argv'] over
This commit is contained in:
commit
31e4533f13
@ -108,6 +108,9 @@ EOPHP
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
global $argv, $argc;
|
||||||
|
$argv = isset($_SERVER['argv']) ? $_SERVER['argv'] : array();
|
||||||
|
$argc = isset($_SERVER['argc']) ? $_SERVER['argc'] : 0;
|
||||||
$components = array();
|
$components = array();
|
||||||
$cmd = array_map('escapeshellarg', $argv);
|
$cmd = array_map('escapeshellarg', $argv);
|
||||||
$exit = 0;
|
$exit = 0;
|
||||||
|
Reference in New Issue
Block a user