aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/cron/task/provider.php
blob: e6ae0f75ecdc9f016e166570380bbe6ccb569fa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
*
* @package phpBB3
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @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
*/
class phpbb_cron_task_provider extends phpbb_extension_provider
{
	/**
	* 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. Additionally all PHP files in includes/cron/task/core/ are
	* tasks.
	*
	* @return array     List of task names
	*/
	protected function find()
	{
		$finder = $this->extension_manager->get_finder();

		return $finder
			->extension_suffix('_task')
			->extension_directory('/cron')
			->core_path('includes/cron/task/core/')
			->get_classes();
	}
}