phpBB
Statistics
| Revision:

root / tags / milestone_3 / phpBB / cron.php

History | View | Annotate | Download (1.6 kB)

1
<?php 
2
/** 
3
*
4
* @package phpBB3
5
* @version $Id: cron.php 5172 2005-07-04 12:06:47Z psotfx $
6
* @copyright (c) 2005 phpBB Group 
7
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
8
*
9
*/
10
11
/**
12
*/
13
define('IN_PHPBB', true);
14
define('IN_CRON', true);
15
$phpbb_root_path = './';
16
$phpEx = substr(strrchr(__FILE__, '.'), 1);
17
include($phpbb_root_path . 'common.'.$phpEx);
18
19
$cron_type = request_var('cron_type', '');
20
21
$use_shutdown_function = (@function_exists('register_shutdown_function')) ? true : false;
22
23
// Run cron-like action
24
// Real cron-based layer will be introduced in 3.2
25
switch ($cron_type)
26
{
27
        case 'queue':
28
                include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
29
                $queue = new queue();
30
                if ($use_shutdown_function)
31
                {
32
                        register_shutdown_function(array(&$queue, 'process'));
33
                }
34
                else
35
                {
36
                        $queue->process();
37
                }
38
                break;
39
40
        case 'tidy_cache':
41
                if ($use_shutdown_function)
42
                {
43
                        register_shutdown_function(array(&$cache, 'tidy'));
44
                }
45
                else
46
                {
47
                        $cache->tidy();
48
                }
49
                break;
50
51
        case 'tidy_database':
52
                include_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
53
54
                if ($use_shutdown_function)
55
                {
56
                        register_shutdown_function('tidy_database');
57
                }
58
                else
59
                {
60
                        tidy_database();
61
                }
62
                break;
63
                
64
        case 'tidy_login_keys':
65
                if ($use_shutdown_function)
66
                {
67
                        register_shutdown_function(array(&$user, 'tidy_login_keys'));
68
                }
69
                else
70
                {
71
                        $user->tidy_login_keys();
72
                }
73
}
74
75
// Output transparent gif
76
header('Cache-Control: no-cache');
77
header('Content-type: image/gif');
78
header('Content-length: 43');
79
80
echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
81
82
flush();
83
exit;
84
85
?>