aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/cron.php
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2010-04-18 13:48:32 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2011-02-12 22:05:49 -0500
commit763dc86c166ab850007fea8da4622e4cd1eeafc8 (patch)
tree27db57c6dd9b319b0355e379e46a161f20f44939 /phpBB/cron.php
parentea3b98ab493c12442f7da1b52798294bcb086457 (diff)
downloadforums-763dc86c166ab850007fea8da4622e4cd1eeafc8.tar
forums-763dc86c166ab850007fea8da4622e4cd1eeafc8.tar.gz
forums-763dc86c166ab850007fea8da4622e4cd1eeafc8.tar.bz2
forums-763dc86c166ab850007fea8da4622e4cd1eeafc8.tar.xz
forums-763dc86c166ab850007fea8da4622e4cd1eeafc8.zip
[feature/system-cron] Fixes to make cron actually run.
PHPBB3-9596
Diffstat (limited to 'phpBB/cron.php')
-rw-r--r--phpBB/cron.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/phpBB/cron.php b/phpBB/cron.php
index 0621d7651b..53540b58e2 100644
--- a/phpBB/cron.php
+++ b/phpBB/cron.php
@@ -48,12 +48,16 @@ function do_cron($run_tasks)
garbage_collection();
}
+$cron_lock = new cron_lock;
if ($cron_lock->lock())
{
if ($config['use_system_cron'])
{
$use_shutdown_function = false;
+ include($phpbb_root_path . 'includes/cron/cron_manager.' . $phpEx);
+ $cron = new cron_manager;
+
$run_tasks = $cron->find_all_ready_tasks();
}
else
@@ -62,14 +66,20 @@ if ($cron_lock->lock())
$use_shutdown_function = (@function_exists('register_shutdown_function')) ? true : false;
output_image();
-
+
+ // If invalid task is specified, empty $run_tasks is passed to do_cron which then does nothing
+ $run_tasks = array();
$task = $cron->find_task($cron_type);
- if ($task) {
- if ($task->is_parametrized()) {
+ if ($task)
+ {
+ if ($task->is_parametrized())
+ {
$task->parse_parameters($_GET);
}
- if ($task->is_ready()) {
- if ($use_shutdown_function && !$task->is_shutdown_function_safe()) {
+ if ($task->is_ready())
+ {
+ if ($use_shutdown_function && !$task->is_shutdown_function_safe())
+ {
$use_shutdown_function = false;
}
$run_tasks = array($task);