aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/cron.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2006-01-19 16:38:00 +0000
committerNils Adermann <naderman@naderman.de>2006-01-19 16:38:00 +0000
commit93960a1b8e7b43c4bc504baeabe6a88427b529c6 (patch)
treed0cfcd0425bc8f965451970e4be2d8961948b203 /phpBB/cron.php
parent38a63d94be400223a463378ecbfd668121c16ce8 (diff)
downloadforums-93960a1b8e7b43c4bc504baeabe6a88427b529c6.tar
forums-93960a1b8e7b43c4bc504baeabe6a88427b529c6.tar.gz
forums-93960a1b8e7b43c4bc504baeabe6a88427b529c6.tar.bz2
forums-93960a1b8e7b43c4bc504baeabe6a88427b529c6.tar.xz
forums-93960a1b8e7b43c4bc504baeabe6a88427b529c6.zip
looks like I forgot to commit these two files :o
git-svn-id: file:///svn/phpbb/trunk@5476 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/cron.php')
-rw-r--r--phpBB/cron.php35
1 files changed, 30 insertions, 5 deletions
diff --git a/phpBB/cron.php b/phpBB/cron.php
index 45d2f81f1d..848c263009 100644
--- a/phpBB/cron.php
+++ b/phpBB/cron.php
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
*
* @package phpBB3
@@ -53,8 +53,33 @@ switch ($cron_type)
break;
case 'tidy_search':
- set_config('search_last_gc', time(), true);
- break;
+ // Select the search method
+ $search_type = $config['search_type'];
+
+ if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx) || (time() - $config['search_last_gc'] <= $config['search_gc']))
+ {
+ break;
+ }
+ include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx");
+
+ // We do some additional checks in the module to ensure it can actually be utilised
+ $error = false;
+ $search = new $search_type($error);
+
+ if ($error)
+ {
+ break;
+ }
+
+ if ($use_shutdown_function)
+ {
+ register_shutdown_function(array(&$search, 'tidy'));
+ }
+ else
+ {
+ $search->tidy();
+ }
+ set_config('search_last_gc', time());
case 'tidy_database':
include_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
@@ -68,7 +93,7 @@ switch ($cron_type)
tidy_database();
}
break;
-
+
case 'tidy_sessions':
if ($use_shutdown_function)
{
@@ -83,7 +108,7 @@ switch ($cron_type)
case 'prune_forum':
$forum_id = request_var('f', 0);
-
+
$sql = 'SELECT forum_id, prune_next, enable_prune, prune_days, prune_viewed, forum_flags, prune_freq
FROM ' . FORUMS_TABLE . "
WHERE forum_id = $forum_id";