diff options
author | Nils Adermann <naderman@naderman.de> | 2013-09-10 14:01:09 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2013-09-16 00:25:27 +0200 |
commit | b95fdacdd378877d277e261465da73deb06e50da (patch) | |
tree | 01d55340b37f412cecd2d898c302e101b8a0ed19 /phpBB/phpbb/cron | |
parent | 196e1813cd37c47965eb6f254ce6a55210a1b751 (diff) | |
download | forums-b95fdacdd378877d277e261465da73deb06e50da.tar forums-b95fdacdd378877d277e261465da73deb06e50da.tar.gz forums-b95fdacdd378877d277e261465da73deb06e50da.tar.bz2 forums-b95fdacdd378877d277e261465da73deb06e50da.tar.xz forums-b95fdacdd378877d277e261465da73deb06e50da.zip |
[ticket/11700] Move all recent code to namespaces
PHPBB3-11700
Diffstat (limited to 'phpBB/phpbb/cron')
-rw-r--r-- | phpBB/phpbb/cron/manager.php | 24 | ||||
-rw-r--r-- | phpBB/phpbb/cron/task/base.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/cron/task/core/prune_all_forums.php | 10 | ||||
-rw-r--r-- | phpBB/phpbb/cron/task/core/prune_forum.php | 16 | ||||
-rw-r--r-- | phpBB/phpbb/cron/task/core/queue.php | 10 | ||||
-rw-r--r-- | phpBB/phpbb/cron/task/core/tidy_cache.php | 10 | ||||
-rw-r--r-- | phpBB/phpbb/cron/task/core/tidy_database.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/cron/task/core/tidy_search.php | 14 | ||||
-rw-r--r-- | phpBB/phpbb/cron/task/core/tidy_sessions.php | 10 | ||||
-rw-r--r-- | phpBB/phpbb/cron/task/core/tidy_warnings.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/cron/task/parametrized.php | 10 | ||||
-rw-r--r-- | phpBB/phpbb/cron/task/task.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/cron/task/wrapper.php | 10 |
13 files changed, 82 insertions, 56 deletions
diff --git a/phpBB/phpbb/cron/manager.php b/phpBB/phpbb/cron/manager.php index 84c9650830..f58ba64a3d 100644 --- a/phpBB/phpbb/cron/manager.php +++ b/phpBB/phpbb/cron/manager.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\cron; + /** * @ignore */ @@ -22,10 +24,10 @@ if (!defined('IN_PHPBB')) * * @package phpBB3 */ -class phpbb_cron_manager +class manager { /** - * Set of phpbb_cron_task_wrapper objects. + * Set of \phpbb\cron\task\wrapper objects. * Array holding all tasks that have been found. * * @var array @@ -52,7 +54,7 @@ class phpbb_cron_manager * Loads tasks given by name, wraps them * and puts them into $this->tasks. * - * @param array|Traversable $tasks Array of instances of phpbb_cron_task + * @param array|Traversable $tasks Array of instances of \phpbb\cron\task\task * * @return null */ @@ -71,7 +73,7 @@ class phpbb_cron_manager * * If no tasks are ready, null is returned. * - * @return phpbb_cron_task_wrapper|null + * @return \phpbb\cron\task\wrapper|null */ public function find_one_ready_task() { @@ -88,7 +90,7 @@ class phpbb_cron_manager /** * Finds all tasks that are ready to run. * - * @return array List of tasks which are ready to run (wrapped in phpbb_cron_task_wrapper). + * @return array List of tasks which are ready to run (wrapped in \phpbb\cron\task\wrapper). */ public function find_all_ready_tasks() { @@ -111,7 +113,7 @@ class phpbb_cron_manager * Web runner uses this method to resolve names to tasks. * * @param string $name Name of the task to look up. - * @return phpbb_cron_task A task corresponding to the given name, or null. + * @return \phpbb\cron\task\task A task corresponding to the given name, or null. */ public function find_task($name) { @@ -126,13 +128,13 @@ class phpbb_cron_manager } /** - * Wraps a task inside an instance of phpbb_cron_task_wrapper. + * Wraps a task inside an instance of \phpbb\cron\task\wrapper. * - * @param phpbb_cron_task $task The task. - * @return phpbb_cron_task_wrapper The wrapped task. + * @param \phpbb\cron\task\task $task The task. + * @return \phpbb\cron\task\wrapper The wrapped task. */ - public function wrap_task(phpbb_cron_task $task) + public function wrap_task(\phpbb\cron\task\task $task) { - return new phpbb_cron_task_wrapper($task, $this->phpbb_root_path, $this->php_ext); + return new \phpbb\cron\task\wrapper($task, $this->phpbb_root_path, $this->php_ext); } } diff --git a/phpBB/phpbb/cron/task/base.php b/phpBB/phpbb/cron/task/base.php index 94a2f267b4..f30c9daf1b 100644 --- a/phpBB/phpbb/cron/task/base.php +++ b/phpBB/phpbb/cron/task/base.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\cron\task; + /** * @ignore */ @@ -26,7 +28,7 @@ if (!defined('IN_PHPBB')) * * @package phpBB3 */ -abstract class phpbb_cron_task_base implements phpbb_cron_task +abstract class base implements \phpbb\cron\task\task { private $name; diff --git a/phpBB/phpbb/cron/task/core/prune_all_forums.php b/phpBB/phpbb/cron/task/core/prune_all_forums.php index 2c5d38cec0..8e3ef25ce6 100644 --- a/phpBB/phpbb/cron/task/core/prune_all_forums.php +++ b/phpBB/phpbb/cron/task/core/prune_all_forums.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\cron\task\core; + /** * @ignore */ @@ -24,7 +26,7 @@ if (!defined('IN_PHPBB')) * * @package phpBB3 */ -class phpbb_cron_task_core_prune_all_forums extends phpbb_cron_task_base +class prune_all_forums extends \phpbb\cron\task\base { protected $phpbb_root_path; protected $php_ext; @@ -36,10 +38,10 @@ class phpbb_cron_task_core_prune_all_forums extends phpbb_cron_task_base * * @param string $phpbb_root_path The root path * @param string $php_ext The PHP extension - * @param phpbb_config $config The config - * @param phpbb_db_driver $db The db connection + * @param \phpbb\config\config $config The config + * @param \phpbb\db\driver\driver $db The db connection */ - public function __construct($phpbb_root_path, $php_ext, phpbb_config $config, phpbb_db_driver $db) + public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\db\driver\driver $db) { $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; diff --git a/phpBB/phpbb/cron/task/core/prune_forum.php b/phpBB/phpbb/cron/task/core/prune_forum.php index 0e4c75c77f..f14ab7b702 100644 --- a/phpBB/phpbb/cron/task/core/prune_forum.php +++ b/phpBB/phpbb/cron/task/core/prune_forum.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\cron\task\core; + /** * @ignore */ @@ -24,7 +26,7 @@ if (!defined('IN_PHPBB')) * * @package phpBB3 */ -class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements phpbb_cron_task_parametrized +class prune_forum extends \phpbb\cron\task\base implements \phpbb\cron\task\parametrized { protected $phpbb_root_path; protected $php_ext; @@ -46,10 +48,10 @@ class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements p * * @param string $phpbb_root_path The root path * @param string $php_ext The PHP extension - * @param phpbb_config $config The config - * @param phpbb_db_driver $db The db connection + * @param \phpbb\config\config $config The config + * @param \phpbb\db\driver\driver $db The db connection */ - public function __construct($phpbb_root_path, $php_ext, phpbb_config $config, phpbb_db_driver $db) + public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\db\driver\driver $db) { $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; @@ -132,15 +134,15 @@ class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements p /** * Parses parameters found in $request, which is an instance of - * phpbb_request_request_interface. + * \phpbb\request\request_interface. * * It is expected to have a key f whose value is id of the forum to be pruned. * - * @param phpbb_request_request_interface $request Request object. + * @param \phpbb\request\request_interface $request Request object. * * @return null */ - public function parse_parameters(phpbb_request_request_interface $request) + public function parse_parameters(\phpbb\request\request_interface $request) { $this->forum_data = null; if ($request->is_set('f')) diff --git a/phpBB/phpbb/cron/task/core/queue.php b/phpBB/phpbb/cron/task/core/queue.php index 732f9c6bea..cb13df86df 100644 --- a/phpBB/phpbb/cron/task/core/queue.php +++ b/phpBB/phpbb/cron/task/core/queue.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\cron\task\core; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * * @package phpBB3 */ -class phpbb_cron_task_core_queue extends phpbb_cron_task_base +class queue extends \phpbb\cron\task\base { protected $phpbb_root_path; protected $php_ext; @@ -31,9 +33,9 @@ class phpbb_cron_task_core_queue extends phpbb_cron_task_base * * @param string $phpbb_root_path The root path * @param string $php_ext The PHP extension - * @param phpbb_config $config The config + * @param \phpbb\config\config $config The config */ - public function __construct($phpbb_root_path, $php_ext, phpbb_config $config) + public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config) { $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; @@ -51,7 +53,7 @@ class phpbb_cron_task_core_queue extends phpbb_cron_task_base { include($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext); } - $queue = new queue(); + $queue = new \queue(); $queue->process(); } diff --git a/phpBB/phpbb/cron/task/core/tidy_cache.php b/phpBB/phpbb/cron/task/core/tidy_cache.php index 4618e8200e..021d5fd8a3 100644 --- a/phpBB/phpbb/cron/task/core/tidy_cache.php +++ b/phpBB/phpbb/cron/task/core/tidy_cache.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\cron\task\core; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * * @package phpBB3 */ -class phpbb_cron_task_core_tidy_cache extends phpbb_cron_task_base +class tidy_cache extends \phpbb\cron\task\base { protected $config; protected $cache; @@ -28,10 +30,10 @@ class phpbb_cron_task_core_tidy_cache extends phpbb_cron_task_base /** * Constructor. * - * @param phpbb_config $config The config - * @param phpbb_cache_driver_driver_interface $cache The cache driver + * @param \phpbb\config\config $config The config + * @param \phpbb\cache\driver\driver_interface $cache The cache driver */ - public function __construct(phpbb_config $config, phpbb_cache_driver_driver_interface $cache) + public function __construct(\phpbb\config\config $config, \phpbb\cache\driver\driver_interface $cache) { $this->config = $config; $this->cache = $cache; diff --git a/phpBB/phpbb/cron/task/core/tidy_database.php b/phpBB/phpbb/cron/task/core/tidy_database.php index b882e7b500..d03cba1d86 100644 --- a/phpBB/phpbb/cron/task/core/tidy_database.php +++ b/phpBB/phpbb/cron/task/core/tidy_database.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\cron\task\core; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * * @package phpBB3 */ -class phpbb_cron_task_core_tidy_database extends phpbb_cron_task_base +class tidy_database extends \phpbb\cron\task\base { protected $phpbb_root_path; protected $php_ext; @@ -31,9 +33,9 @@ class phpbb_cron_task_core_tidy_database extends phpbb_cron_task_base * * @param string $phpbb_root_path The root path * @param string $php_ext The PHP extension - * @param phpbb_config $config The config + * @param \phpbb\config\config $config The config */ - public function __construct($phpbb_root_path, $php_ext, phpbb_config $config) + public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config) { $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; diff --git a/phpBB/phpbb/cron/task/core/tidy_search.php b/phpBB/phpbb/cron/task/core/tidy_search.php index a3d5b7dbd2..ebd0d86cbc 100644 --- a/phpBB/phpbb/cron/task/core/tidy_search.php +++ b/phpBB/phpbb/cron/task/core/tidy_search.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\cron\task\core; + /** * @ignore */ @@ -22,7 +24,7 @@ if (!defined('IN_PHPBB')) * * @package phpBB3 */ -class phpbb_cron_task_core_tidy_search extends phpbb_cron_task_base +class tidy_search extends \phpbb\cron\task\base { protected $phpbb_root_path; protected $php_ext; @@ -36,12 +38,12 @@ class phpbb_cron_task_core_tidy_search extends phpbb_cron_task_base * * @param string $phpbb_root_path The root path * @param string $php_ext The PHP extension - * @param phpbb_auth $auth The auth - * @param phpbb_config $config The config - * @param phpbb_db_driver $db The db connection - * @param phpbb_user $user The user + * @param \phpbb\auth\auth $auth The auth + * @param \phpbb\config\config $config The config + * @param \phpbb\db\driver\driver $db The db connection + * @param \phpbb\user $user The user */ - public function __construct($phpbb_root_path, $php_ext, phpbb_auth $auth, phpbb_config $config, phpbb_db_driver $db, phpbb_user $user) + public function __construct($phpbb_root_path, $php_ext, \phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\db\driver\driver $db, \phpbb\user $user) { $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; diff --git a/phpBB/phpbb/cron/task/core/tidy_sessions.php b/phpBB/phpbb/cron/task/core/tidy_sessions.php index 95f55235c9..5df019ae46 100644 --- a/phpBB/phpbb/cron/task/core/tidy_sessions.php +++ b/phpBB/phpbb/cron/task/core/tidy_sessions.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\cron\task\core; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * * @package phpBB3 */ -class phpbb_cron_task_core_tidy_sessions extends phpbb_cron_task_base +class tidy_sessions extends \phpbb\cron\task\base { protected $config; protected $user; @@ -28,10 +30,10 @@ class phpbb_cron_task_core_tidy_sessions extends phpbb_cron_task_base /** * Constructor. * - * @param phpbb_config $config The config - * @param phpbb_user $user The user + * @param \phpbb\config\config $config The config + * @param \phpbb\user $user The user */ - public function __construct(phpbb_config $config, phpbb_user $user) + public function __construct(\phpbb\config\config $config, \phpbb\user $user) { $this->config = $config; $this->user = $user; diff --git a/phpBB/phpbb/cron/task/core/tidy_warnings.php b/phpBB/phpbb/cron/task/core/tidy_warnings.php index 2a7798e56e..1cc0abbe88 100644 --- a/phpBB/phpbb/cron/task/core/tidy_warnings.php +++ b/phpBB/phpbb/cron/task/core/tidy_warnings.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\cron\task\core; + /** * @ignore */ @@ -22,7 +24,7 @@ if (!defined('IN_PHPBB')) * * @package phpBB3 */ -class phpbb_cron_task_core_tidy_warnings extends phpbb_cron_task_base +class tidy_warnings extends \phpbb\cron\task\base { protected $phpbb_root_path; protected $php_ext; @@ -33,9 +35,9 @@ class phpbb_cron_task_core_tidy_warnings extends phpbb_cron_task_base * * @param string $phpbb_root_path The root path * @param string $php_ext The PHP extension - * @param phpbb_config $config The config + * @param \phpbb\config\config $config The config */ - public function __construct($phpbb_root_path, $php_ext, phpbb_config $config) + public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config) { $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; diff --git a/phpBB/phpbb/cron/task/parametrized.php b/phpBB/phpbb/cron/task/parametrized.php index 9a6a55c6bc..1d2f449c58 100644 --- a/phpBB/phpbb/cron/task/parametrized.php +++ b/phpBB/phpbb/cron/task/parametrized.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\cron\task; + /** * @ignore */ @@ -26,7 +28,7 @@ if (!defined('IN_PHPBB')) * * @package phpBB3 */ -interface phpbb_cron_task_parametrized extends phpbb_cron_task +interface parametrized extends \phpbb\cron\task\task { /** * Returns parameters of this cron task as an array. @@ -39,14 +41,14 @@ interface phpbb_cron_task_parametrized extends phpbb_cron_task /** * Parses parameters found in $request, which is an instance of - * phpbb_request_request_interface. + * \phpbb\request\request_interface. * * $request contains user input and must not be trusted. * Cron task must validate all data before using it. * - * @param phpbb_request_request_interface $request Request object. + * @param \phpbb\request\request_interface $request Request object. * * @return null */ - public function parse_parameters(phpbb_request_request_interface $request); + public function parse_parameters(\phpbb\request\request_interface $request); } diff --git a/phpBB/phpbb/cron/task/task.php b/phpBB/phpbb/cron/task/task.php index 2d585df96d..84218c4fc9 100644 --- a/phpBB/phpbb/cron/task/task.php +++ b/phpBB/phpbb/cron/task/task.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\cron\task; + /** * @ignore */ @@ -19,7 +21,7 @@ if (!defined('IN_PHPBB')) * Cron task interface * @package phpBB3 */ -interface phpbb_cron_task +interface task { /** * Returns the name of the task. diff --git a/phpBB/phpbb/cron/task/wrapper.php b/phpBB/phpbb/cron/task/wrapper.php index 386fb5b383..aa015966c6 100644 --- a/phpBB/phpbb/cron/task/wrapper.php +++ b/phpBB/phpbb/cron/task/wrapper.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\cron\task; + /** * @ignore */ @@ -21,7 +23,7 @@ if (!defined('IN_PHPBB')) * * @package phpBB3 */ -class phpbb_cron_task_wrapper +class wrapper { protected $task; protected $phpbb_root_path; @@ -32,9 +34,9 @@ class phpbb_cron_task_wrapper * * Wraps a task $task, which must implement cron_task interface. * - * @param phpbb_cron_task $task The cron task to wrap. + * @param \phpbb\cron\task\task $task The cron task to wrap. */ - public function __construct(phpbb_cron_task $task, $phpbb_root_path, $php_ext) + public function __construct(\phpbb\cron\task\task $task, $phpbb_root_path, $php_ext) { $this->task = $task; $this->phpbb_root_path = $phpbb_root_path; @@ -51,7 +53,7 @@ class phpbb_cron_task_wrapper */ public function is_parametrized() { - return $this->task instanceof phpbb_cron_task_parametrized; + return $this->task instanceof \phpbb\cron\task\parametrized; } /** |