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 | |
| 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
| -rw-r--r-- | phpBB/common.php | 2 | ||||
| -rw-r--r-- | phpBB/config/services.yml | 7 | ||||
| -rw-r--r-- | phpBB/download/file.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/di/pass/collection.php (renamed from phpBB/includes/di/pass/cron.php) | 15 | ||||
| -rw-r--r-- | phpBB/install/database_update.php | 2 |
5 files changed, 15 insertions, 13 deletions
diff --git a/phpBB/common.php b/phpBB/common.php index e24f9b4359..fb2f86341b 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -106,7 +106,7 @@ $phpbb_container = phpbb_create_compiled_container( new phpbb_di_extension_core($phpbb_root_path), ), array( - new phpbb_di_pass_cron(), + new phpbb_di_pass_collection('cron.task_collection', 'cron.task'), ), $phpbb_root_path, $phpEx diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml index 76a7049f19..42bb473e66 100644 --- a/phpBB/config/services.yml +++ b/phpBB/config/services.yml @@ -91,13 +91,6 @@ services: - .%core.php_ext% - @cache.driver - processor.ext: - class: phpbb_di_processor_ext - arguments: - - @ext.manager - tags: - - { name: container.processor } - request: class: phpbb_request diff --git a/phpBB/download/file.php b/phpBB/download/file.php index eb1ec85afe..b99ce2d688 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -65,7 +65,7 @@ if (isset($_GET['avatar'])) new phpbb_di_extension_core($phpbb_root_path), ), array( - new phpbb_di_pass_cron(), + new phpbb_di_pass_collection('cron.task_collection', 'cron.task'), ), $phpbb_root_path, $phpEx 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)); } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index a5c4e2acd3..bc45b27cdc 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -123,7 +123,7 @@ $phpbb_container = phpbb_create_compiled_container( new phpbb_di_extension_core($phpbb_root_path), ), array( - new phpbb_di_pass_cron(), + new phpbb_di_pass_collection('cron.task_collection', 'cron.task'), ), $phpbb_root_path, $phpEx |
