Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fabpot committed Dec 4, 2017
2 parents 1f2213a + 1ff22e6 commit 31e4533
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Symfony/Bridge/PhpUnit/bin/simple-phpunit
Expand Up @@ -108,6 +108,9 @@ EOPHP

}

global $argv, $argc;
$argv = isset($_SERVER['argv']) ? $_SERVER['argv'] : array();
$argc = isset($_SERVER['argc']) ? $_SERVER['argc'] : 0;
$components = array();
$cmd = array_map('escapeshellarg', $argv);
$exit = 0;
Expand Down

0 comments on commit 31e4533

Please sign in to comment.