aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/console
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-07-17 16:03:55 +0200
committerTristan Darricau <github@nicofuma.fr>2014-07-17 16:03:55 +0200
commit42477861a45935b10285a1434f4ffaf5b199c5c2 (patch)
tree800c39bba49eba389c25760deb73069c7f57d36b /phpBB/phpbb/console
parent0d2a4780769e0e8d7b47c3a954c6dcecddcce581 (diff)
parent7f4d4250066eadb6badd43c4ce1b8f2f84e083cf (diff)
downloadforums-42477861a45935b10285a1434f4ffaf5b199c5c2.tar
forums-42477861a45935b10285a1434f4ffaf5b199c5c2.tar.gz
forums-42477861a45935b10285a1434f4ffaf5b199c5c2.tar.bz2
forums-42477861a45935b10285a1434f4ffaf5b199c5c2.tar.xz
forums-42477861a45935b10285a1434f4ffaf5b199c5c2.zip
Merge pull request #2576 from carlo94it/ticket/12685
[ticket/12685] New CLI container for load extensions * carlo94it/ticket/12685: [ticket/12685] Setup class loader for extensions only if not in safe mode [ticket/12685] Replace getParameterOption with hasParameterOption [ticket/12685] Do not dump container [ticket/12685] Override getDefaultInputDefinition() [ticket/12685] Removed unused USE statement [ticket/12685] Inject console.command_collection instead of the container [ticket/12685] Add a new line [ticket/12685] Container is dumped by default [ticket/12685] Removed spaces [ticket/12685] Add --safe-mode [ticket/12685] We need extensions enabled [ticket/12685] Add space after foreach [ticket/12685] Add console collection and fixing CLI
Diffstat (limited to 'phpBB/phpbb/console')
-rw-r--r--phpBB/phpbb/console/application.php29
1 files changed, 22 insertions, 7 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);
}
}