mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 22:08:54 +00:00
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
38 lines
836 B
PHP
38 lines
836 B
PHP
<?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));
|
|
}
|
|
}
|
|
}
|