aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/console
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/console')
-rw-r--r--phpBB/phpbb/console/application.php29
-rw-r--r--phpBB/phpbb/console/command/extension/disable.php2
-rw-r--r--phpBB/phpbb/console/command/extension/enable.php4
-rw-r--r--phpBB/phpbb/console/command/extension/purge.php2
4 files changed, 26 insertions, 11 deletions
diff --git a/phpBB/phpbb/console/application.php b/phpBB/phpbb/console/application.php
index b1f0635913..bc4897af18 100644
--- a/phpBB/phpbb/console/application.php
+++ b/phpBB/phpbb/console/application.php
@@ -17,7 +17,6 @@ use Symfony\Component\Console\Shell;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\DependencyInjection\TaggedContainerInterface;
class application extends \Symfony\Component\Console\Application
{
@@ -38,9 +37,26 @@ class application extends \Symfony\Component\Console\Application
*/
public function __construct($name, $version, \phpbb\user $user)
{
+ $this->user = $user;
+
parent::__construct($name, $version);
+ }
- $this->user = $user;
+ /**
+ * {@inheritdoc}
+ */
+ protected function getDefaultInputDefinition()
+ {
+ $input_definition = parent::getDefaultInputDefinition();
+
+ $input_definition->addOption(new InputOption(
+ 'safe-mode',
+ null,
+ InputOption::VALUE_NONE,
+ $this->user->lang('CLI_DESCRIPTION_OPTION_SAFE_MODE')
+ ));
+
+ return $input_definition;
}
/**
@@ -73,14 +89,13 @@ class application extends \Symfony\Component\Console\Application
/**
* Register a set of commands from the container
*
- * @param TaggedContainerInterface $container The container
- * @param string $tag The tag used to register the commands
+ * @param \phpbb\di\service_collection $command_collection The console service collection
*/
- public function register_container_commands(TaggedContainerInterface $container, $tag = 'console.command')
+ public function register_container_commands(\phpbb\di\service_collection $command_collection)
{
- foreach($container->findTaggedServiceIds($tag) as $id => $void)
+ foreach ($command_collection as $service_command)
{
- $this->add($container->get($id));
+ $this->add($service_command);
}
}
diff --git a/phpBB/phpbb/console/command/extension/disable.php b/phpBB/phpbb/console/command/extension/disable.php
index 5f0e74b984..c04848aa01 100644
--- a/phpBB/phpbb/console/command/extension/disable.php
+++ b/phpBB/phpbb/console/command/extension/disable.php
@@ -37,7 +37,7 @@ class disable extends command
$this->manager->disable($name);
$this->manager->load_extensions();
- if ($this->manager->enabled($name))
+ if ($this->manager->is_enabled($name))
{
$output->writeln("<error>Could not disable extension $name</error>");
return 1;
diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php
index 0cdf26d4db..86a034cdf4 100644
--- a/phpBB/phpbb/console/command/extension/enable.php
+++ b/phpBB/phpbb/console/command/extension/enable.php
@@ -37,9 +37,9 @@ class enable extends command
$this->manager->enable($name);
$this->manager->load_extensions();
- if ($this->manager->enabled($name))
+ if ($this->manager->is_enabled($name))
{
- $this->log->add('admin', ANONYMOUS, '', 'LOG_EXTENSION_ENABLE', time(), array($name));
+ $this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_ENABLE', time(), array($name));
$output->writeln("<info>Successfully enabled extension $name</info>");
return 0;
}
diff --git a/phpBB/phpbb/console/command/extension/purge.php b/phpBB/phpbb/console/command/extension/purge.php
index 4e57641d83..841598b90a 100644
--- a/phpBB/phpbb/console/command/extension/purge.php
+++ b/phpBB/phpbb/console/command/extension/purge.php
@@ -37,7 +37,7 @@ class purge extends command
$this->manager->purge($name);
$this->manager->load_extensions();
- if ($this->manager->enabled($name))
+ if ($this->manager->is_enabled($name))
{
$output->writeln("<error>Could not purge extension $name</error>");
return 1;