aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2009-09-01 18:37:51 +0000
committerAndreas Fischer <bantu@phpbb.com>2009-09-01 18:37:51 +0000
commit6134b641e395f1abd0a4fc71c50470ab93dea07e (patch)
tree6eb0b0caa93c84ba687dee601f9ec23a3ee1e2e3 /phpBB/includes/functions.php
parent9d3a851ab56041aeb6e64cb8886ec30662cd0226 (diff)
downloadforums-6134b641e395f1abd0a4fc71c50470ab93dea07e.tar
forums-6134b641e395f1abd0a4fc71c50470ab93dea07e.tar.gz
forums-6134b641e395f1abd0a4fc71c50470ab93dea07e.tar.bz2
forums-6134b641e395f1abd0a4fc71c50470ab93dea07e.tar.xz
forums-6134b641e395f1abd0a4fc71c50470ab93dea07e.zip
Save some calls here, since page_footer(true) gets called quite often.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10087 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index f18514096f..96ecf739ed 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -4288,6 +4288,7 @@ function page_footer($run_cron = true)
if (!defined('IN_CRON') && $run_cron && !$config['board_disable'])
{
$call_cron = true;
+ $time_now = (!empty($user->time_now) && is_int($user->time_now)) ? $user->time_now : time();
// Any old lock present?
if (!empty($config['cron_lock']))
@@ -4295,7 +4296,7 @@ function page_footer($run_cron = true)
$cron_time = explode(' ', $config['cron_lock']);
// If 1 hour lock is present we do not call cron.php
- if ($cron_time[0] + 3600 >= time())
+ if ($cron_time[0] + 3600 >= $time_now)
{
$call_cron = false;
}
@@ -4307,31 +4308,31 @@ function page_footer($run_cron = true)
{
$cron_type = '';
- if (time() - $config['queue_interval'] > $config['last_queue_run'] && !defined('IN_ADMIN') && file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
+ if ($time_now - $config['queue_interval'] > $config['last_queue_run'] && !defined('IN_ADMIN') && file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
{
// Process email queue
$cron_type = 'queue';
}
- else if (method_exists($cache, 'tidy') && time() - $config['cache_gc'] > $config['cache_last_gc'])
+ 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() - $config['warnings_gc'] > $config['warnings_last_gc']))
+ else if ($config['warnings_expire_days'] && ($time_now - $config['warnings_gc'] > $config['warnings_last_gc']))
{
$cron_type = 'tidy_warnings';
}
- else if (time() - $config['database_gc'] > $config['database_last_gc'])
+ else if ($time_now - $config['database_gc'] > $config['database_last_gc'])
{
// Tidy the database
$cron_type = 'tidy_database';
}
- else if (time() - $config['search_gc'] > $config['search_last_gc'])
+ else if ($time_now - $config['search_gc'] > $config['search_last_gc'])
{
// Tidy the search
$cron_type = 'tidy_search';
}
- else if (time() - $config['session_gc'] > $config['session_last_gc'])
+ else if ($time_now - $config['session_gc'] > $config['session_last_gc'])
{
$cron_type = 'tidy_sessions';
}