[FrameworkBundle] Display a proper warning for deprecated --env and --no-debug options
This commit is contained in:
parent
b6758e9614
commit
a40048e740
@ -63,11 +63,16 @@ class Application extends BaseApplication
|
|||||||
public function doRun(InputInterface $input, OutputInterface $output)
|
public function doRun(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
if ($input->hasParameterOption(array('-e', '--env'), true)) {
|
if ($input->hasParameterOption(array('-e', '--env'), true)) {
|
||||||
@trigger_error('The "--env" option and its "-e" shortcut are deprecated since Symfony 4.2. Set the "APP_ENV" environment variable instead.', E_USER_DEPRECATED);
|
$notice = 'The "--env" option and its "-e" shortcut are deprecated since Symfony 4.2, set the "APP_ENV" environment variable instead.';
|
||||||
|
$io = (new SymfonyStyle($input, $output))->getErrorStyle();
|
||||||
|
$io->warning($notice);
|
||||||
|
@trigger_error($notice, E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($input->hasParameterOption('--no-debug', true)) {
|
if ($input->hasParameterOption('--no-debug', true)) {
|
||||||
@trigger_error('The "--no-debug" option is deprecated since Symfony 4.2. Set the "APP_DEBUG" environment variable to "0" instead.', E_USER_DEPRECATED);
|
$notice = 'The "--no-debug" option is deprecated since Symfony 4.2, set the "APP_DEBUG" environment variable to "0" instead.';
|
||||||
|
($io ?? (new SymfonyStyle($input, $output))->getErrorStyle())->warning($notice);
|
||||||
|
@trigger_error($notice, E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->kernel->boot();
|
$this->kernel->boot();
|
||||||
|
Reference in New Issue
Block a user