diff options
| author | Igor Wiedler <igor@wiedler.ch> | 2011-02-13 15:54:42 +0100 |
|---|---|---|
| committer | Igor Wiedler <igor@wiedler.ch> | 2011-02-13 15:54:42 +0100 |
| commit | 04bd2e640e771948671ab6554df8962de980f511 (patch) | |
| tree | d1e5a226ca875e940d1d98c710051d1911d8b2ad /phpBB/includes/functions.php | |
| parent | 8f0e9aee5ce518937b7ed05c2cd602e85e5b0b8a (diff) | |
| parent | 1fd8d6de7f6bb41505530c83e487a9dc18bd25af (diff) | |
| download | forums-04bd2e640e771948671ab6554df8962de980f511.tar forums-04bd2e640e771948671ab6554df8962de980f511.tar.gz forums-04bd2e640e771948671ab6554df8962de980f511.tar.bz2 forums-04bd2e640e771948671ab6554df8962de980f511.tar.xz forums-04bd2e640e771948671ab6554df8962de980f511.zip | |
Merge branch 'feature/system-cron' into develop
* feature/system-cron: (67 commits)
[feature/system-cron] More tests for cron manager.
[feature/system-cron] Added documentation for cron manager constructor.
[feature/system-cron] Remove an unecessary assignment and an unecessary comment
[feature/system-cron] Clarify comments about flush() call in cron.
[feature/system-cron] preg_match returns int so cast to bool, fix comment
[feature/system-cron] Rename lock() to acquire and unlock() to release.
[feature/system-cron] Cache cron's task names.
[feature/system-cron] Use a RecursiveDirectoryIterator instead of readdir.
[feature/system-cron] Add array type hints if appropriate and remove globals.
[feature/system-cron] Make use of the new config class in locks.
[feature/system-cron] Fix duplicate instantiation of class loader in tests.
[feature/system-cron] Abstract the database locking mechanism out of cron.
[feature/system-cron] Move tests to phpunit.xml and always load class loader
[feature/system-cron] Basic tests for cron manager.
[feature/system-cron] Added @param/@return documentation
[feature/system-cron] Add phpDoc documentation for everything else.
[feature/system-cron] Cast result in cron_manager::is_valid_name() to bool.
[feature/system-cron] Add phpDoc documentation for phpbb_cron_manager class.
[feature/system-cron] Add phpDoc documentation for phpbb_cron_lock class.
[feature/system-cron] Adjust SQL query style to follow coding guidelines.
...
Diffstat (limited to 'phpBB/includes/functions.php')
| -rw-r--r-- | phpBB/includes/functions.php | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 056d578e75..418e8dc51d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4595,7 +4595,7 @@ function page_footer($run_cron = true) // Call cron-type script $call_cron = false; - if (!defined('IN_CRON') && $run_cron && !$config['board_disable']) + if (!defined('IN_CRON') && !$config['use_system_cron'] && $run_cron && !$config['board_disable']) { $call_cron = true; $time_now = (!empty($user->time_now) && is_int($user->time_now)) ? $user->time_now : time(); @@ -4616,40 +4616,13 @@ function page_footer($run_cron = true) // Call cron job? if ($call_cron) { - $cron_type = ''; + global $cron; + $task = $cron->find_one_ready_task(); - if ($time_now - $config['queue_interval'] > $config['last_queue_run'] && !defined('IN_ADMIN') && file_exists($phpbb_root_path . 'cache/queue.' . $phpEx)) + if ($task) { - // Process email queue - $cron_type = 'queue'; - } - else if (method_exists($cache, 'tidy') && $time_now - $config['cache_gc'] > $config['cache_last_gc']) - { - // Tidy the cache - $cron_type = 'tidy_cache'; - } - else if ($config['warnings_expire_days'] && ($time_now - $config['warnings_gc'] > $config['warnings_last_gc'])) - { - $cron_type = 'tidy_warnings'; - } - else if ($time_now - $config['database_gc'] > $config['database_last_gc']) - { - // Tidy the database - $cron_type = 'tidy_database'; - } - else if ($time_now - $config['search_gc'] > $config['search_last_gc']) - { - // Tidy the search - $cron_type = 'tidy_search'; - } - else if ($time_now - $config['session_gc'] > $config['session_last_gc']) - { - $cron_type = 'tidy_sessions'; - } - - if ($cron_type) - { - $template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid($phpbb_root_path . 'cron.' . $phpEx, 'cron_type=' . $cron_type) . '" width="1" height="1" alt="cron" />'); + $url = $task->get_url(); + $template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="cron" />'); } } |
