aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/di/pass
diff options
context:
space:
mode:
authorDavid King <imkingdavid@gmail.com>2012-10-21 16:09:43 -0400
committerIgor Wiedler <igor@wiedler.ch>2012-11-10 11:40:49 +0100
commitcb2725dd5a04118de8628e10f940e926f4fa8fa1 (patch)
treecb79bf44756d029efe62cde8d3d98cf1ae00b5a3 /phpBB/includes/di/pass
parentad3edf505a9e9ef7f139b033f70a1106539ce0de (diff)
downloadforums-cb2725dd5a04118de8628e10f940e926f4fa8fa1.tar
forums-cb2725dd5a04118de8628e10f940e926f4fa8fa1.tar.gz
forums-cb2725dd5a04118de8628e10f940e926f4fa8fa1.tar.bz2
forums-cb2725dd5a04118de8628e10f940e926f4fa8fa1.tar.xz
forums-cb2725dd5a04118de8628e10f940e926f4fa8fa1.zip
[feature/compiled-dic] Fix cron task loading
We cannot use container tags at run time if we are using a cached, compiled container object (i.e. phpbb_cache_container) so we have to load them beforehand. PHPBB3-11152
Diffstat (limited to 'phpBB/includes/di/pass')
-rw-r--r--phpBB/includes/di/pass/cron.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/phpBB/includes/di/pass/cron.php b/phpBB/includes/di/pass/cron.php
new file mode 100644
index 0000000000..b5fc4af9fc
--- /dev/null
+++ b/phpBB/includes/di/pass/cron.php
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* @package phpBB3
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
+
+class phpbb_di_pass_cron implements CompilerPassInterface
+{
+ /**
+ * Modify the container before it is passed to the rest of the code
+ *
+ * @param ContainerBuilder $container ContainerBuilder object
+ * @return null
+ */
+ public function process(ContainerBuilder $container)
+ {
+ $definition = $container->getDefinition('cron.task_collection');
+
+ foreach ($container->findTaggedServiceIds('cron.task') as $id => $data)
+ {
+ $definition->addMethodCall('offsetSet', array(null, $id));
+ }
+ }
+}