diff options
| author | Andreas Fischer <bantu@phpbb.com> | 2014-05-23 00:34:28 +0200 |
|---|---|---|
| committer | Andreas Fischer <bantu@phpbb.com> | 2014-05-23 00:34:28 +0200 |
| commit | c3639a4d5fd88c00e1596cc7fc0ad4ba2a11fbc9 (patch) | |
| tree | 92ba3c08d6e2f983f3ace57478440bbdc4687639 | |
| parent | 9b52f17fcc67322441495b9b9bf35a1238f84d0f (diff) | |
| parent | 1eef2f278271361ad0ffc52bd5444ce05ff454ae (diff) | |
| download | forums-c3639a4d5fd88c00e1596cc7fc0ad4ba2a11fbc9.tar forums-c3639a4d5fd88c00e1596cc7fc0ad4ba2a11fbc9.tar.gz forums-c3639a4d5fd88c00e1596cc7fc0ad4ba2a11fbc9.tar.bz2 forums-c3639a4d5fd88c00e1596cc7fc0ad4ba2a11fbc9.tar.xz forums-c3639a4d5fd88c00e1596cc7fc0ad4ba2a11fbc9.zip | |
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus:
[ticket/12576] Retrieve the cron_manager in cron.php if needed
[ticket/12576] Remove cron from common.php
| -rw-r--r-- | phpBB/common.php | 5 | ||||
| -rw-r--r-- | phpBB/cron.php | 8 | ||||
| -rw-r--r-- | phpBB/includes/functions.php | 3 |
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) |
