[ticket/16955] Remove shell option as this has been removed in Symfony 3.0

PHPBB3-16955
This commit is contained in:
Marc Alexander 2022-12-27 14:29:13 +01:00
parent 948023078b
commit a8b878349a
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -21,11 +21,6 @@ use Symfony\Component\Console\Output\OutputInterface;
class application extends \Symfony\Component\Console\Application
{
/**
* @var bool Indicates whether or not we are in a shell
*/
protected $in_shell = false;
/**
* @var \phpbb\config\config Config object
*/
@ -62,41 +57,6 @@ class application extends \Symfony\Component\Console\Application
return $input_definition;
}
/**
* Gets the help message.
*
* It's a hack of the default help message to display the --shell
* option only for the application and not for all the commands.
*
* @return string A help message.
*/
public function getHelp()
{
// If we are already in a shell
// we do not want to have the --shell option available
if ($this->in_shell)
{
return parent::getHelp();
}
try
{
$definition = $this->getDefinition();
$definition->addOption(new InputOption(
'--shell',
'-s',
InputOption::VALUE_NONE,
$this->language->lang('CLI_DESCRIPTION_OPTION_SHELL')
));
}
catch (\LogicException $e)
{
// Do nothing
}
return parent::getHelp();
}
/**
* Register a set of commands from the container
*
@ -118,25 +78,6 @@ class application extends \Symfony\Component\Console\Application
}
}
/**
* {@inheritdoc}
*/
public function doRun(InputInterface $input, OutputInterface $output)
{
// Run a shell if the --shell (or -s) option is set and if no command name is specified
// Also, we do not want to have the --shell option available if we are already in a shell
if (!$this->in_shell && $this->getCommandName($input) === null && $input->hasParameterOption(array('--shell', '-s')))
{
$shell = new Shell($this);
$this->in_shell = true;
$shell->run();
return 0;
}
return parent::doRun($input, $output);
}
/**
* Register global options
*