2011-08-21 02:57:01 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @package phpBB3
|
|
|
|
* @copyright (c) 2011 phpBB Group
|
2011-12-31 13:32:52 +00:00
|
|
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
2011-08-21 02:57:01 -04:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
if (!defined('IN_PHPBB'))
|
|
|
|
{
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides cron manager with tasks
|
|
|
|
*
|
|
|
|
* Finds installed cron tasks and makes them available to the cron manager.
|
|
|
|
*
|
|
|
|
* @package phpBB3
|
|
|
|
*/
|
2011-08-31 17:49:48 -04:00
|
|
|
class phpbb_cron_task_provider extends phpbb_extension_provider
|
2011-08-21 02:57:01 -04:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* 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
|
2011-08-30 00:06:15 -04:00
|
|
|
* suffix. Additionally all PHP files in includes/cron/task/core/ are
|
|
|
|
* tasks.
|
2011-08-21 02:57:01 -04:00
|
|
|
*
|
|
|
|
* @return array List of task names
|
|
|
|
*/
|
2011-08-31 17:49:48 -04:00
|
|
|
protected function find()
|
2011-08-21 02:57:01 -04:00
|
|
|
{
|
|
|
|
$finder = $this->extension_manager->get_finder();
|
|
|
|
|
|
|
|
return $finder
|
2011-11-18 16:42:53 +01:00
|
|
|
->extension_suffix('_task')
|
|
|
|
->extension_directory('/cron')
|
|
|
|
->core_path('includes/cron/task/core/')
|
2011-08-21 02:57:01 -04:00
|
|
|
->get_classes();
|
|
|
|
}
|
|
|
|
}
|