mirror of
https://github.com/symfony/recipes.git
synced 2026-09-11 23:26:27 +03:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user