diff options
author | Igor Wiedler <igor@wiedler.ch> | 2012-11-10 23:34:27 +0100 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-11-10 23:34:27 +0100 |
commit | 231d743ba9966e8304e0dd226ebf5eb7fb3b70d8 (patch) | |
tree | 23cafb57d78388c6f3cf6c8316a851bd4f2300d0 /phpBB/includes/di | |
parent | 798c006e7fe55bc1de30e42a4c25e8c74911c865 (diff) | |
download | forums-231d743ba9966e8304e0dd226ebf5eb7fb3b70d8.tar forums-231d743ba9966e8304e0dd226ebf5eb7fb3b70d8.tar.gz forums-231d743ba9966e8304e0dd226ebf5eb7fb3b70d8.tar.bz2 forums-231d743ba9966e8304e0dd226ebf5eb7fb3b70d8.tar.xz forums-231d743ba9966e8304e0dd226ebf5eb7fb3b70d8.zip |
[ticket/11152] Change phpbb_di_pass_cron to generic phpbb_di_pass_collection
PHPBB3-11152
Diffstat (limited to 'phpBB/includes/di')
-rw-r--r-- | phpBB/includes/di/pass/collection.php (renamed from phpBB/includes/di/pass/cron.php) | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/phpBB/includes/di/pass/cron.php b/phpBB/includes/di/pass/collection.php index 53fe0a61c8..09e4b08f62 100644 --- a/phpBB/includes/di/pass/cron.php +++ b/phpBB/includes/di/pass/collection.php @@ -18,8 +18,17 @@ if (!defined('IN_PHPBB')) use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -class phpbb_di_pass_cron implements CompilerPassInterface +class phpbb_di_pass_collection implements CompilerPassInterface { + private $collection_service; + private $service_tag; + + public function __construct($collection_service, $service_tag) + { + $this->collection_service = $collection_service; + $this->service_tag = $service_tag; + } + /** * Modify the container before it is passed to the rest of the code * @@ -28,9 +37,9 @@ class phpbb_di_pass_cron implements CompilerPassInterface */ public function process(ContainerBuilder $container) { - $definition = $container->getDefinition('cron.task_collection'); + $definition = $container->getDefinition($this->collection_service); - foreach ($container->findTaggedServiceIds('cron.task') as $id => $data) + foreach ($container->findTaggedServiceIds($this->service_tag) as $id => $data) { $definition->addMethodCall('add', array($id)); } |