phpbb/phpBB/includes/cron/task/collection.php
David King cb2725dd5a [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
2012-11-10 11:40:49 +01:00

72 lines
1 KiB
PHP

<?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;
}
/**
* Collects cron tasks
*
* @package phpBB3
*/
class phpbb_cron_task_collection implements ArrayAccess
{
/**
* ArrayAccess method
*
* @param mixed $offset Array offset
*/
public function offsetExists($offset)
{
return isset($this->tasks[$offset]);
}
/**
* ArrayAccess method
*
* @param mixed $offset Array offset
*/
public function offsetGet($offset)
{
return $this->offsetExists($offset) ? $this->tasks[$offset] : null;
}
/**
* ArrayAccess method
*
* @param mixed $offset Array offset
* @param mixed $value New value
*/
public function offsetSet($offset, $value)
{
if ($offset === null)
{
$this->tasks[] = $value;
}
else
{
$this->tasks[$offset] = $value;
}
}
/**
* ArrayAccess method
*
* @param mixed $offset Array offset
*/
public function offsetUnset($offset)
{
$this->tasks[$offset] = null;
}
}