diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2005-04-30 14:28:07 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2005-04-30 14:28:07 +0000 |
commit | 15c0535cbcc2a719b6984a82c1d3d0ec3350f10f (patch) | |
tree | d3e9433294f8c337e71a244f1ce92c25c03eadfe /phpBB/cron.php | |
parent | 0dec4135c54085caf9fd31f40ad4ff1fe94ba071 (diff) | |
download | forums-15c0535cbcc2a719b6984a82c1d3d0ec3350f10f.tar forums-15c0535cbcc2a719b6984a82c1d3d0ec3350f10f.tar.gz forums-15c0535cbcc2a719b6984a82c1d3d0ec3350f10f.tar.bz2 forums-15c0535cbcc2a719b6984a82c1d3d0ec3350f10f.tar.xz forums-15c0535cbcc2a719b6984a82c1d3d0ec3350f10f.zip |
- new queue invocation method
git-svn-id: file:///svn/phpbb/trunk@5136 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/cron.php')
-rw-r--r-- | phpBB/cron.php | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/phpBB/cron.php b/phpBB/cron.php new file mode 100644 index 0000000000..3ca76d79ba --- /dev/null +++ b/phpBB/cron.php @@ -0,0 +1,75 @@ +<?php +/** +* +* @package phpBB3 +* @version $Id$ +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +*/ +define('IN_PHPBB', true); +define('IN_CRON', true); +$phpbb_root_path = './'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +include($phpbb_root_path . 'common.'.$phpEx); + +$cron_type = request_var('cron_type', ''); + +$use_shutdown_function = (@function_exists('register_shutdown_function')) ? true : false; + +// Run cron-like action +// Real cron-based layer will be introduced in 3.2 +switch ($cron_type) +{ + case 'queue': + 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(); + } + break; + + case 'tidy_cache': + if ($use_shutdown_function) + { + register_shutdown_function(array(&$cache, 'tidy')); + } + else + { + $cache->tidy(); + } + break; + + case 'tidy_database': + include_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx); + + if ($use_shutdown_function) + { + register_shutdown_function('tidy_database'); + } + else + { + tidy_database(); + } + break; +} + +// Output transparent gif +header('Cache-Control: no-cache'); +header('Content-type: image/gif'); +header('Content-length: 43'); + +echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='); + +flush(); +exit; + +?>
\ No newline at end of file |