aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/cron.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2011-01-07 20:58:28 +0100
committerOleg Pudeyev <oleg@bsdpower.com>2011-02-12 22:05:53 -0500
commit3a3a8bb96d0cb7be2529ab095f305fd3b042783c (patch)
treee8bc13cacb8ab2f9803c2d13d55025e4903e4d7f /phpBB/cron.php
parent6e5e4721d83c8bde9780b02bd011bdbf5d188dea (diff)
downloadforums-3a3a8bb96d0cb7be2529ab095f305fd3b042783c.tar
forums-3a3a8bb96d0cb7be2529ab095f305fd3b042783c.tar.gz
forums-3a3a8bb96d0cb7be2529ab095f305fd3b042783c.tar.bz2
forums-3a3a8bb96d0cb7be2529ab095f305fd3b042783c.tar.xz
forums-3a3a8bb96d0cb7be2529ab095f305fd3b042783c.zip
[feature/system-cron] Abstract the database locking mechanism out of cron.
Added a number of tests for the locking mechanism which can now lock arbitrary config variables. PHPBB3-9596
Diffstat (limited to 'phpBB/cron.php')
-rw-r--r--phpBB/cron.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/phpBB/cron.php b/phpBB/cron.php
index d1b96b12e1..80e744d358 100644
--- a/phpBB/cron.php
+++ b/phpBB/cron.php
@@ -33,9 +33,9 @@ function output_image()
// flush();
}
-function do_cron($run_tasks)
+function do_cron($cron_lock, $run_tasks)
{
- global $cron_lock, $config;
+ global $config;
foreach ($run_tasks as $task)
{
@@ -73,7 +73,7 @@ else
output_image();
}
-$cron_lock = new phpbb_cron_lock();
+$cron_lock = new phpbb_lock_db('cron_lock', $config, $db);
if ($cron_lock->lock())
{
if ($config['use_system_cron'])
@@ -103,11 +103,11 @@ if ($cron_lock->lock())
}
if ($use_shutdown_function)
{
- register_shutdown_function('do_cron', $run_tasks);
+ register_shutdown_function('do_cron', $cron_lock, $run_tasks);
}
else
{
- do_cron($run_tasks);
+ do_cron($cron_lock, $run_tasks);
}
}
else