mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/16955] Remove shell option as this has been removed in Symfony 3.0
PHPBB3-16955
This commit is contained in:
parent
948023078b
commit
a8b878349a
1 changed files with 0 additions and 59 deletions
|
@ -21,11 +21,6 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
class application extends \Symfony\Component\Console\Application
|
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
|
* @var \phpbb\config\config Config object
|
||||||
*/
|
*/
|
||||||
|
@ -62,41 +57,6 @@ class application extends \Symfony\Component\Console\Application
|
||||||
return $input_definition;
|
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
|
* 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
|
* Register global options
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue