aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2014-05-23 00:34:28 +0200
committerAndreas Fischer <bantu@phpbb.com>2014-05-23 00:34:28 +0200
commit1eef2f278271361ad0ffc52bd5444ce05ff454ae (patch)
tree92ba3c08d6e2f983f3ace57478440bbdc4687639
parentb0dd144fe3e40202a8b07d7fc29f7c40f78d2a85 (diff)
parent004b3178761fb4e5f954049194751d1fb7f512c0 (diff)
downloadforums-1eef2f278271361ad0ffc52bd5444ce05ff454ae.tar
forums-1eef2f278271361ad0ffc52bd5444ce05ff454ae.tar.gz
forums-1eef2f278271361ad0ffc52bd5444ce05ff454ae.tar.bz2
forums-1eef2f278271361ad0ffc52bd5444ce05ff454ae.tar.xz
forums-1eef2f278271361ad0ffc52bd5444ce05ff454ae.zip
Merge pull request #2484 from Nicofuma/ticket/12576
[ticket/12576] Remove cron from common.php * Nicofuma/ticket/12576: [ticket/12576] Retrieve the cron_manager in cron.php if needed [ticket/12576] Remove cron from common.php
-rw-r--r--phpBB/common.php5
-rw-r--r--phpBB/cron.php8
-rw-r--r--phpBB/includes/functions.php3
3 files changed, 5 insertions, 11 deletions
diff --git a/phpBB/common.php b/phpBB/common.php
index 4ad669a021..d8375d365b 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -108,11 +108,6 @@ foreach ($phpbb_hook_finder->find() as $hook)
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
}
-if (!$config['use_system_cron'])
-{
- $cron = $phpbb_container->get('cron.manager');
-}
-
/**
* Main event which is triggered on every page
*
diff --git a/phpBB/cron.php b/phpBB/cron.php
index 787183f689..f63642faa2 100644
--- a/phpBB/cron.php
+++ b/phpBB/cron.php
@@ -59,11 +59,7 @@ function do_cron($cron_lock, $run_tasks)
//
// If DEBUG is defined and cron lock cannot be obtained, a message will be printed.
-if ($config['use_system_cron'])
-{
- $cron = $phpbb_container->get('cron.manager');
-}
-else
+if (!$config['use_system_cron'])
{
$cron_type = request_var('cron_type', '');
@@ -74,6 +70,8 @@ else
$cron_lock = $phpbb_container->get('cron.lock_db');
if ($cron_lock->acquire())
{
+ $cron = $phpbb_container->get('cron.manager');
+
if ($config['use_system_cron'])
{
$run_tasks = $cron->find_all_ready_tasks();
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 49568bb1b2..adb6e1a0a0 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -5116,7 +5116,8 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
// Call cron job?
if ($call_cron)
{
- global $cron;
+ global $phpbb_container;
+ $cron = $phpbb_container->get('cron.manager');
$task = $cron->find_one_ready_task();
if ($task)