Improve the console script

- look for the --env and --no-debug only before a -- separator, to respect
  the support for --
- avoid passing an empty string as parameter option name (which would never
  match anyway, but causes php warning is some Symfony versions instead of
  being ignored silently).
This commit is contained in:
Christophe Coevoet
2018-02-15 12:16:49 +01:00
parent c7a4138ebc
commit 60c0fc35b3
+2 -2
View File
@@ -23,8 +23,8 @@ if (!isset($_SERVER['APP_ENV'])) {
}
$input = new ArgvInput();
$env = $input->getParameterOption(['--env', '-e'], $_SERVER['APP_ENV'] ?? 'dev');
$debug = ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env)) && !$input->hasParameterOption(['--no-debug', '']);
$env = $input->getParameterOption(['--env', '-e'], $_SERVER['APP_ENV'] ?? 'dev', true);
$debug = ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env)) && !$input->hasParameterOption('--no-debug', true);
if ($debug) {
umask(0000);