aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/cron.php91
1 files changed, 10 insertions, 81 deletions
diff --git a/phpBB/cron.php b/phpBB/cron.php
index 3993a149b5..16880b8914 100644
--- a/phpBB/cron.php
+++ b/phpBB/cron.php
@@ -21,7 +21,6 @@ $user->session_begin(false);
$auth->acl($user->data);
$cron_type = request_var('cron_type', '');
-$use_shutdown_function = (@function_exists('register_shutdown_function')) ? true : false;
// Output transparent gif
header('Cache-Control: no-cache');
@@ -79,23 +78,10 @@ switch ($cron_type)
break;
}
- // A user reported using the mail() function while using shutdown does not work. We do not want to risk that.
- if ($use_shutdown_function && !$config['smtp_delivery'])
- {
- $use_shutdown_function = false;
- }
-
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
$queue = new queue();
- if ($use_shutdown_function)
- {
- register_shutdown_function(array(&$queue, 'process'));
- }
- else
- {
- $queue->process();
- }
+ $queue->process();
break;
@@ -106,14 +92,7 @@ switch ($cron_type)
break;
}
- if ($use_shutdown_function)
- {
- register_shutdown_function(array(&$cache, 'tidy'));
- }
- else
- {
- $cache->tidy();
- }
+ $cache->tidy();
break;
@@ -138,14 +117,7 @@ switch ($cron_type)
break;
}
- if ($use_shutdown_function)
- {
- register_shutdown_function(array(&$search, 'tidy'));
- }
- else
- {
- $search->tidy();
- }
+ $search->tidy();
break;
@@ -158,14 +130,7 @@ switch ($cron_type)
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
- if ($use_shutdown_function)
- {
- register_shutdown_function('tidy_warnings');
- }
- else
- {
- tidy_warnings();
- }
+ tidy_warnings();
break;
@@ -178,14 +143,7 @@ switch ($cron_type)
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
- if ($use_shutdown_function)
- {
- register_shutdown_function('tidy_database');
- }
- else
- {
- tidy_database();
- }
+ tidy_database();
break;
@@ -196,14 +154,7 @@ switch ($cron_type)
break;
}
- if ($use_shutdown_function)
- {
- register_shutdown_function(array(&$user, 'session_gc'));
- }
- else
- {
- $user->session_gc();
- }
+ $user->session_gc();
break;
@@ -230,26 +181,12 @@ switch ($cron_type)
if ($row['prune_days'])
{
- if ($use_shutdown_function)
- {
- register_shutdown_function('auto_prune', $row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']);
- }
- else
- {
- auto_prune($row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']);
- }
+ auto_prune($row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']);
}
if ($row['prune_viewed'])
{
- if ($use_shutdown_function)
- {
- register_shutdown_function('auto_prune', $row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']);
- }
- else
- {
- auto_prune($row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']);
- }
+ auto_prune($row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']);
}
}
@@ -257,16 +194,8 @@ switch ($cron_type)
}
// Unloading cache and closing db after having done the dirty work.
-if ($use_shutdown_function)
-{
- register_shutdown_function('unlock_cron');
- register_shutdown_function('garbage_collection');
-}
-else
-{
- unlock_cron();
- garbage_collection();
-}
+unlock_cron();
+garbage_collection();
exit;