diff options
author | Igor Wiedler <igor@wiedler.ch> | 2010-10-28 22:30:44 +0200 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2011-02-12 22:05:52 -0500 |
commit | bd58fa49c000e99d049cbd96306315e1bd35b938 (patch) | |
tree | e58128b8db2fe74199d248d8fa66b3b97032cbd9 | |
parent | a9e0f9947d1d71779a6c02dbc4c40f70f6a98723 (diff) | |
download | forums-bd58fa49c000e99d049cbd96306315e1bd35b938.tar forums-bd58fa49c000e99d049cbd96306315e1bd35b938.tar.gz forums-bd58fa49c000e99d049cbd96306315e1bd35b938.tar.bz2 forums-bd58fa49c000e99d049cbd96306315e1bd35b938.tar.xz forums-bd58fa49c000e99d049cbd96306315e1bd35b938.zip |
[feature/system-cron] make parameterized interface autoloadable
also extract it to a separate file
PHPBB3-9596
-rw-r--r-- | phpBB/includes/cron/task.php | 32 | ||||
-rw-r--r-- | phpBB/includes/cron/task/core/prune_forum.php | 2 | ||||
-rw-r--r-- | phpBB/includes/cron/task_parametrized.php | 49 | ||||
-rw-r--r-- | phpBB/includes/cron/task_wrapper.php | 2 |
4 files changed, 51 insertions, 34 deletions
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 @@ +<?php +/** +* +* @package phpBB3 +* @version $Id$ +* @copyright (c) 2010 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* 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_cron_task_parametrized 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); +}
\ No newline at end of file diff --git a/phpBB/includes/cron/task_wrapper.php b/phpBB/includes/cron/task_wrapper.php index b3662a4e31..159382a8d1 100644 --- a/phpBB/includes/cron/task_wrapper.php +++ b/phpBB/includes/cron/task_wrapper.php @@ -40,7 +40,7 @@ class phpbb_cron_task_wrapper */ public function is_parametrized() { - return $this->task instanceof phpbb_parametrized_cron_task; + return $this->task instanceof phpbb_cron_task_parametrized; } /** |