diff --git a/phpBB/includes/cron/task.php b/phpBB/includes/cron/task.php index e66acd5492..38fb2a6cd1 100644 --- a/phpBB/includes/cron/task.php +++ b/phpBB/includes/cron/task.php @@ -46,35 +46,3 @@ interface phpbb_cron_task */ public function is_shutdown_function_safe(); } - -/** -* Parametrized cron task interface. -* -* Parametrized cron tasks are somewhat of a cross between regular cron tasks and -* delayed jobs. Whereas regular cron tasks perform some action globally, -* parametrized cron tasks perform actions on a particular object (or objects). -* Parametrized cron tasks do not make sense and are not usable without -* specifying these objects. -* -* @package phpBB3 -*/ -interface phpbb_parametrized_cron_task extends cron_task -{ - /** - * Returns parameters of this cron task as an array. - * - * The array must map string keys to string values. - */ - public function get_parameters(); - - /** - * Parses parameters found in $params, which is an array. - * - * $params contains user input and must not be trusted. - * In normal operation $params contains the same data that was returned by - * get_parameters method. However, a malicious user can supply arbitrary - * data in $params. - * Cron task must validate all keys and values in $params before using them. - */ - public function parse_parameters($params); -} diff --git a/phpBB/includes/cron/task/core/prune_forum.php b/phpBB/includes/cron/task/core/prune_forum.php index eb01e535a9..5efcde4102 100644 --- a/phpBB/includes/cron/task/core/prune_forum.php +++ b/phpBB/includes/cron/task/core/prune_forum.php @@ -25,7 +25,7 @@ if (!defined('IN_PHPBB')) * * @package phpBB3 */ -class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements phpbb_parametrized_cron_task +class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements phpbb_cron_task_parametrized { private $forum_data; diff --git a/phpBB/includes/cron/task_parametrized.php b/phpBB/includes/cron/task_parametrized.php new file mode 100644 index 0000000000..1906009ebe --- /dev/null +++ b/phpBB/includes/cron/task_parametrized.php @@ -0,0 +1,49 @@ +task instanceof phpbb_parametrized_cron_task; + return $this->task instanceof phpbb_cron_task_parametrized; } /**