mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[feature/system-cron] Add phpDoc documentation for everything else.
PHPBB3-9596
This commit is contained in:
committed by
Oleg Pudeyev
parent
3c0561b68f
commit
47702b8ca7
@@ -33,6 +33,8 @@ abstract class phpbb_cron_task_base implements phpbb_cron_task
|
|||||||
*
|
*
|
||||||
* For example, a cron task that prunes forums can only run when
|
* For example, a cron task that prunes forums can only run when
|
||||||
* forum pruning is enabled.
|
* forum pruning is enabled.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function is_runnable()
|
public function is_runnable()
|
||||||
{
|
{
|
||||||
@@ -42,6 +44,8 @@ abstract class phpbb_cron_task_base implements phpbb_cron_task
|
|||||||
/**
|
/**
|
||||||
* Returns whether this cron task should run now, because enough time
|
* Returns whether this cron task should run now, because enough time
|
||||||
* has passed since it was last run.
|
* has passed since it was last run.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function should_run()
|
public function should_run()
|
||||||
{
|
{
|
||||||
@@ -50,6 +54,8 @@ abstract class phpbb_cron_task_base implements phpbb_cron_task
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this cron task can be run in shutdown function.
|
* Returns whether this cron task can be run in shutdown function.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function is_shutdown_function_safe()
|
public function is_shutdown_function_safe()
|
||||||
{
|
{
|
||||||
|
@@ -28,6 +28,8 @@ class phpbb_cron_task_core_prune_all_forums extends phpbb_cron_task_base
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Runs this cron task.
|
* Runs this cron task.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
@@ -60,6 +62,8 @@ class phpbb_cron_task_core_prune_all_forums extends phpbb_cron_task_base
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this cron task can run, given current board configuration.
|
* Returns whether this cron task can run, given current board configuration.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function is_runnable()
|
public function is_runnable()
|
||||||
{
|
{
|
||||||
|
@@ -37,6 +37,8 @@ class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements p
|
|||||||
* If $forum_data is not given, forum id will be retrieved via request_var
|
* If $forum_data is not given, forum id will be retrieved via request_var
|
||||||
* and a database query will be performed to load the necessary information
|
* and a database query will be performed to load the necessary information
|
||||||
* about the forum.
|
* about the forum.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct($forum_data = null)
|
public function __construct($forum_data = null)
|
||||||
{
|
{
|
||||||
@@ -53,6 +55,8 @@ class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements p
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs this cron task.
|
* Runs this cron task.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
@@ -75,6 +79,8 @@ class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements p
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this cron task can run, given current board configuration.
|
* Returns whether this cron task can run, given current board configuration.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function is_runnable()
|
public function is_runnable()
|
||||||
{
|
{
|
||||||
@@ -85,6 +91,8 @@ class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements p
|
|||||||
/**
|
/**
|
||||||
* Returns whether this cron task should run now, because enough time
|
* Returns whether this cron task should run now, because enough time
|
||||||
* has passed since it was last run.
|
* has passed since it was last run.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function should_run()
|
public function should_run()
|
||||||
{
|
{
|
||||||
@@ -93,8 +101,9 @@ class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements p
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns parameters of this cron task as an array.
|
* Returns parameters of this cron task as an array.
|
||||||
*
|
|
||||||
* The array has one key, f, whose value is id of the forum to be pruned.
|
* The array has one key, f, whose value is id of the forum to be pruned.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function get_parameters()
|
public function get_parameters()
|
||||||
{
|
{
|
||||||
@@ -106,6 +115,8 @@ class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements p
|
|||||||
* phpbb_request_interface.
|
* phpbb_request_interface.
|
||||||
*
|
*
|
||||||
* It is expected to have a key f whose value is id of the forum to be pruned.
|
* It is expected to have a key f whose value is id of the forum to be pruned.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function parse_parameters(phpbb_request_interface $request)
|
public function parse_parameters(phpbb_request_interface $request)
|
||||||
{
|
{
|
||||||
|
@@ -24,6 +24,8 @@ class phpbb_cron_task_core_queue extends phpbb_cron_task_base
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Runs this cron task.
|
* Runs this cron task.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
@@ -38,6 +40,8 @@ class phpbb_cron_task_core_queue extends phpbb_cron_task_base
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this cron task can run, given current board configuration.
|
* Returns whether this cron task can run, given current board configuration.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function is_runnable()
|
public function is_runnable()
|
||||||
{
|
{
|
||||||
@@ -48,6 +52,8 @@ class phpbb_cron_task_core_queue extends phpbb_cron_task_base
|
|||||||
/**
|
/**
|
||||||
* Returns whether this cron task should run now, because enough time
|
* Returns whether this cron task should run now, because enough time
|
||||||
* has passed since it was last run.
|
* has passed since it was last run.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function should_run()
|
public function should_run()
|
||||||
{
|
{
|
||||||
@@ -57,6 +63,8 @@ class phpbb_cron_task_core_queue extends phpbb_cron_task_base
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this cron task can be run in shutdown function.
|
* Returns whether this cron task can be run in shutdown function.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function is_shutdown_function_safe()
|
public function is_shutdown_function_safe()
|
||||||
{
|
{
|
||||||
|
@@ -24,6 +24,8 @@ class phpbb_cron_task_core_tidy_cache extends phpbb_cron_task_base
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Runs this cron task.
|
* Runs this cron task.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
@@ -33,6 +35,8 @@ class phpbb_cron_task_core_tidy_cache extends phpbb_cron_task_base
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this cron task can run, given current board configuration.
|
* Returns whether this cron task can run, given current board configuration.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function is_runnable()
|
public function is_runnable()
|
||||||
{
|
{
|
||||||
@@ -43,6 +47,8 @@ class phpbb_cron_task_core_tidy_cache extends phpbb_cron_task_base
|
|||||||
/**
|
/**
|
||||||
* Returns whether this cron task should run now, because enough time
|
* Returns whether this cron task should run now, because enough time
|
||||||
* has passed since it was last run.
|
* has passed since it was last run.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function should_run()
|
public function should_run()
|
||||||
{
|
{
|
||||||
|
@@ -24,6 +24,8 @@ class phpbb_cron_task_core_tidy_database extends phpbb_cron_task_base
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Runs this cron task.
|
* Runs this cron task.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
@@ -38,6 +40,8 @@ class phpbb_cron_task_core_tidy_database extends phpbb_cron_task_base
|
|||||||
/**
|
/**
|
||||||
* Returns whether this cron task should run now, because enough time
|
* Returns whether this cron task should run now, because enough time
|
||||||
* has passed since it was last run.
|
* has passed since it was last run.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function should_run()
|
public function should_run()
|
||||||
{
|
{
|
||||||
|
@@ -26,6 +26,8 @@ class phpbb_cron_task_core_tidy_search extends phpbb_cron_task_base
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Runs this cron task.
|
* Runs this cron task.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
@@ -51,6 +53,8 @@ class phpbb_cron_task_core_tidy_search extends phpbb_cron_task_base
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this cron task can run, given current board configuration.
|
* Returns whether this cron task can run, given current board configuration.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function is_runnable()
|
public function is_runnable()
|
||||||
{
|
{
|
||||||
@@ -65,6 +69,8 @@ class phpbb_cron_task_core_tidy_search extends phpbb_cron_task_base
|
|||||||
/**
|
/**
|
||||||
* Returns whether this cron task should run now, because enough time
|
* Returns whether this cron task should run now, because enough time
|
||||||
* has passed since it was last run.
|
* has passed since it was last run.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function should_run()
|
public function should_run()
|
||||||
{
|
{
|
||||||
|
@@ -24,6 +24,8 @@ class phpbb_cron_task_core_tidy_sessions extends phpbb_cron_task_base
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Runs this cron task.
|
* Runs this cron task.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
@@ -34,6 +36,8 @@ class phpbb_cron_task_core_tidy_sessions extends phpbb_cron_task_base
|
|||||||
/**
|
/**
|
||||||
* Returns whether this cron task should run now, because enough time
|
* Returns whether this cron task should run now, because enough time
|
||||||
* has passed since it was last run.
|
* has passed since it was last run.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function should_run()
|
public function should_run()
|
||||||
{
|
{
|
||||||
|
@@ -26,6 +26,8 @@ class phpbb_cron_task_core_tidy_warnings extends phpbb_cron_task_base
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Runs this cron task.
|
* Runs this cron task.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
@@ -39,6 +41,8 @@ class phpbb_cron_task_core_tidy_warnings extends phpbb_cron_task_base
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this cron task can run, given current board configuration.
|
* Returns whether this cron task can run, given current board configuration.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function is_runnable()
|
public function is_runnable()
|
||||||
{
|
{
|
||||||
@@ -49,6 +53,8 @@ class phpbb_cron_task_core_tidy_warnings extends phpbb_cron_task_base
|
|||||||
/**
|
/**
|
||||||
* Returns whether this cron task should run now, because enough time
|
* Returns whether this cron task should run now, because enough time
|
||||||
* has passed since it was last run.
|
* has passed since it was last run.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function should_run()
|
public function should_run()
|
||||||
{
|
{
|
||||||
|
@@ -32,6 +32,8 @@ interface phpbb_cron_task_parametrized extends phpbb_cron_task
|
|||||||
* Returns parameters of this cron task as an array.
|
* Returns parameters of this cron task as an array.
|
||||||
*
|
*
|
||||||
* The array must map string keys to string values.
|
* The array must map string keys to string values.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function get_parameters();
|
public function get_parameters();
|
||||||
|
|
||||||
@@ -41,6 +43,8 @@ interface phpbb_cron_task_parametrized extends phpbb_cron_task
|
|||||||
*
|
*
|
||||||
* $request contains user input and must not be trusted.
|
* $request contains user input and must not be trusted.
|
||||||
* Cron task must validate all data before using it.
|
* Cron task must validate all data before using it.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function parse_parameters(phpbb_request_interface $request);
|
public function parse_parameters(phpbb_request_interface $request);
|
||||||
}
|
}
|
@@ -23,6 +23,8 @@ interface phpbb_cron_task
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Runs this cron task.
|
* Runs this cron task.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function run();
|
public function run();
|
||||||
|
|
||||||
@@ -31,17 +33,23 @@ interface phpbb_cron_task
|
|||||||
*
|
*
|
||||||
* For example, a cron task that prunes forums can only run when
|
* For example, a cron task that prunes forums can only run when
|
||||||
* forum pruning is enabled.
|
* forum pruning is enabled.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function is_runnable();
|
public function is_runnable();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this cron task should run now, because enough time
|
* Returns whether this cron task should run now, because enough time
|
||||||
* has passed since it was last run.
|
* has passed since it was last run.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function should_run();
|
public function should_run();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this cron task can be run in shutdown function.
|
* Returns whether this cron task can be run in shutdown function.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function is_shutdown_function_safe();
|
public function is_shutdown_function_safe();
|
||||||
}
|
}
|
||||||
|
@@ -25,6 +25,8 @@ class phpbb_cron_task_wrapper
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Wraps a task $task, which must implement cron_task interface.
|
* Wraps a task $task, which must implement cron_task interface.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(phpbb_cron_task $task)
|
public function __construct(phpbb_cron_task $task)
|
||||||
{
|
{
|
||||||
@@ -36,6 +38,8 @@ class phpbb_cron_task_wrapper
|
|||||||
*
|
*
|
||||||
* Parametrized tasks accept parameters during initialization and must
|
* Parametrized tasks accept parameters during initialization and must
|
||||||
* normally be scheduled with parameters.
|
* normally be scheduled with parameters.
|
||||||
|
*
|
||||||
|
* @return bool Whether or not this task is parametrized.
|
||||||
*/
|
*/
|
||||||
public function is_parametrized()
|
public function is_parametrized()
|
||||||
{
|
{
|
||||||
@@ -47,6 +51,8 @@ class phpbb_cron_task_wrapper
|
|||||||
*
|
*
|
||||||
* A task is ready to run when it is runnable according to current configuration
|
* A task is ready to run when it is runnable according to current configuration
|
||||||
* and enough time has passed since it was last run.
|
* and enough time has passed since it was last run.
|
||||||
|
*
|
||||||
|
* @return bool Whether the wrapped task is ready to run.
|
||||||
*/
|
*/
|
||||||
public function is_ready()
|
public function is_ready()
|
||||||
{
|
{
|
||||||
@@ -55,6 +61,8 @@ class phpbb_cron_task_wrapper
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name of wrapped task. It is the same as the wrapped class's class name.
|
* Returns the name of wrapped task. It is the same as the wrapped class's class name.
|
||||||
|
*
|
||||||
|
* @return string Class name of wrapped task.
|
||||||
*/
|
*/
|
||||||
public function get_name()
|
public function get_name()
|
||||||
{
|
{
|
||||||
@@ -63,6 +71,8 @@ class phpbb_cron_task_wrapper
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a url through which this task may be invoked via web.
|
* Returns a url through which this task may be invoked via web.
|
||||||
|
*
|
||||||
|
* @return string URL
|
||||||
*/
|
*/
|
||||||
public function get_url()
|
public function get_url()
|
||||||
{
|
{
|
||||||
@@ -88,6 +98,8 @@ class phpbb_cron_task_wrapper
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Forwards all other method calls to the wrapped task implementation.
|
* Forwards all other method calls to the wrapped task implementation.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function __call($name, $args)
|
public function __call($name, $args)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user