aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/cron
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/cron')
-rw-r--r--phpBB/includes/cron/provider.php50
1 files changed, 4 insertions, 46 deletions
diff --git a/phpBB/includes/cron/provider.php b/phpBB/includes/cron/provider.php
index ee0f93a308..42552e1d8e 100644
--- a/phpBB/includes/cron/provider.php
+++ b/phpBB/includes/cron/provider.php
@@ -22,52 +22,20 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_cron_provider implements IteratorAggregate
+class phpbb_cron_provider extends phpbb_extension_provider
{
/**
- * Array holding all found task class names.
- *
- * @var array
- */
- protected $task_names = array();
-
- /**
- * An extension manager to search for cron tasks in extensions.
- * @var phpbb_extension_manager
- */
- protected $extension_manager;
-
- /**
- * Constructor. Loads all available tasks.
- *
- * Tasks will be looked up in the core task directory located in
- * includes/cron/task/core/ and in extensions. Task classes will be
- * autoloaded and must be named according to autoloading naming conventions.
- *
- * Tasks in extensions must be located in a directory called cron or a subdir
- * of a directory called cron. The class and filename must end in a _task
- * suffix.
- *
- * @param phpbb_extension_manager $extension_manager phpBB extension manager
- */
- public function __construct(phpbb_extension_manager $extension_manager)
- {
- $this->extension_manager = $extension_manager;
-
- $this->task_names = $this->find_cron_task_names();
- }
-
- /**
* Finds cron task names using the extension manager.
*
* All PHP files in includes/cron/task/core/ are considered tasks. Tasks
* in extensions have to be located in a directory called cron or a subdir
* of a directory called cron. The class and filename must end in a _task
- * suffix.
+ * suffix. Additionally all PHP files in includes/cron/task/core/ are
+ * tasks.
*
* @return array List of task names
*/
- public function find_cron_task_names()
+ public function find()
{
$finder = $this->extension_manager->get_finder();
@@ -79,14 +47,4 @@ class phpbb_cron_provider implements IteratorAggregate
->default_directory('')
->get_classes();
}
-
- /**
- * Retrieve an iterator over all task names
- *
- * @return ArrayIterator An iterator for the array of task names
- */
- public function getIterator()
- {
- return new ArrayIterator($this->task_names);
- }
}