aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlo <carlo@phpbbitalia.net>2014-07-12 17:19:43 +0200
committerCarlo <carlo@phpbbitalia.net>2014-07-12 17:19:43 +0200
commitb95ab440280ca5e5e94fe1f96f4f947734e37da3 (patch)
tree3cde5cab6601ad6fee59f73272dd5248ce35dce6
parent0d6fe203729cdade106e21383c3faa5f71b378ce (diff)
downloadforums-b95ab440280ca5e5e94fe1f96f4f947734e37da3.tar
forums-b95ab440280ca5e5e94fe1f96f4f947734e37da3.tar.gz
forums-b95ab440280ca5e5e94fe1f96f4f947734e37da3.tar.bz2
forums-b95ab440280ca5e5e94fe1f96f4f947734e37da3.tar.xz
forums-b95ab440280ca5e5e94fe1f96f4f947734e37da3.zip
[ticket/12685] Add console collection and fixing CLI
Added a commands service collection and removed CLI container PHPBB3-12685
-rw-r--r--phpBB/config/console.yml6
-rw-r--r--phpBB/phpbb/console/application.php11
2 files changed, 11 insertions, 6 deletions
diff --git a/phpBB/config/console.yml b/phpBB/config/console.yml
index 00b8f9cec0..f4beb1c089 100644
--- a/phpBB/config/console.yml
+++ b/phpBB/config/console.yml
@@ -1,4 +1,10 @@
services:
+ console.command_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: console.command }
console.command.cache.purge:
class: phpbb\console\command\cache\purge
arguments:
diff --git a/phpBB/phpbb/console/application.php b/phpBB/phpbb/console/application.php
index b1f0635913..72fcee5cfa 100644
--- a/phpBB/phpbb/console/application.php
+++ b/phpBB/phpbb/console/application.php
@@ -17,7 +17,7 @@ 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;
+use Symfony\Component\DependencyInjection\ContainerInterface;
class application extends \Symfony\Component\Console\Application
{
@@ -73,14 +73,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 ContainerInterface $container The container
*/
- public function register_container_commands(TaggedContainerInterface $container, $tag = 'console.command')
+ public function register_container_commands(ContainerInterface $container)
{
- foreach($container->findTaggedServiceIds($tag) as $id => $void)
+ foreach($container->get('console.command_collection') as $service_command)
{
- $this->add($container->get($id));
+ $this->add($service_command);
}
}