mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 18:54:08 +02:00
Merge remote-tracking branch 'upstream/develop' into ticket/11015
* upstream/develop: (31 commits) [ticket/11194] Service tag data is stored in an array so access it correctly [ticket/11193] Instantiate a single collection_pass for all collections [ticket/11152] Basic tests for the container functions [ticket/11152] Compile the install container [ticket/11152] Throw error if services.yml is missing [ticket/11152] Remove old container processor calls [ticket/11152] Use realpath in container extensions consistently [ticket/11152] Rename collection to collection_pass [ticket/11152] Remove @api docblocks [ticket/11152] Create separate function for debug-dependent container [ticket/11152] Change phpbb_di_pass_cron to generic phpbb_di_pass_collection [ticket/11152] Convert cron_task_collection to generic di_service_collection [ticket/11152] Use relative root path in container, one dumped container per path [ticket/11152] Move container functions to a separate function file [feature/compiled-dic] Rename $phpEx to $php_ext in new code [feature/compiled-dic] Use an absolute path for core.root_path parameter [feature/compiled-dic] Update the composer.lock file [feature/compiled-dic] Purge cache to make ext services available right away [feature/compiled-dic] Fix root path when container is created after install [feature/compiled-dic] Remove old test ...
This commit is contained in:
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package phpBB3
|
||||
* @copyright (c) 2011 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\TaggedContainerInterface;
|
||||
|
||||
/**
|
||||
* Provides cron manager with tasks
|
||||
*
|
||||
* Finds installed cron tasks and makes them available to the cron manager.
|
||||
*
|
||||
* @package phpBB3
|
||||
*/
|
||||
class phpbb_cron_task_provider implements IteratorAggregate
|
||||
{
|
||||
private $container;
|
||||
|
||||
public function __construct(TaggedContainerInterface $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an iterator over all items
|
||||
*
|
||||
* @return ArrayIterator An iterator for the array of cron tasks
|
||||
*/
|
||||
public function getIterator()
|
||||
{
|
||||
$definitions = $this->container->findTaggedServiceIds('cron.task');
|
||||
|
||||
$tasks = array();
|
||||
foreach ($definitions as $name => $definition)
|
||||
{
|
||||
$task = $this->container->get($name);
|
||||
if ($task instanceof phpbb_cron_task_base)
|
||||
{
|
||||
$task->set_name($name);
|
||||
}
|
||||
|
||||
$tasks[] = $task;
|
||||
}
|
||||
|
||||
return new ArrayIterator($tasks);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user