|
From: Andreas F. <ba...@ph...> - 2009-09-01 18:38:31
|
Author: bantu
Date: Tue Sep 1 19:37:51 2009
New Revision: 10087
Log:
Save some calls here, since page_footer(true) gets called quite often.
Modified:
branches/phpBB-3_0_0/phpBB/includes/functions.php
Modified: branches/phpBB-3_0_0/phpBB/includes/functions.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/includes/functions.php (original)
--- branches/phpBB-3_0_0/phpBB/includes/functions.php Tue Sep 1 19:37:51 2009
***************
*** 4288,4293 ****
--- 4288,4294 ----
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,4301 ****
$cron_time = explode(' ', $config['cron_lock']);
// If 1 hour lock is present we do not call cron.php
! if ($cron_time[0] + 3600 >= time())
{
$call_cron = false;
}
--- 4296,4302 ----
$cron_time = explode(' ', $config['cron_lock']);
// If 1 hour lock is present we do not call cron.php
! if ($cron_time[0] + 3600 >= $time_now)
{
$call_cron = false;
}
***************
*** 4307,4337 ****
{
$cron_type = '';
! if (time() - $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'])
{
// Tidy the cache
$cron_type = 'tidy_cache';
}
! else if ($config['warnings_expire_days'] && (time() - $config['warnings_gc'] > $config['warnings_last_gc']))
{
$cron_type = 'tidy_warnings';
}
! else if (time() - $config['database_gc'] > $config['database_last_gc'])
{
// Tidy the database
$cron_type = 'tidy_database';
}
! else if (time() - $config['search_gc'] > $config['search_last_gc'])
{
// Tidy the search
$cron_type = 'tidy_search';
}
! else if (time() - $config['session_gc'] > $config['session_last_gc'])
{
$cron_type = 'tidy_sessions';
}
--- 4308,4338 ----
{
$cron_type = '';
! 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_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';
}
|