blob: 7c47be06c169a414d1b1c0732f16066fb226170f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2010 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Tidy cache cron task.
*
* @package phpBB3
*/
class tidy_cache_cron_task extends cron_task_base
{
/**
* Runs this cron task.
*/
public function run()
{
global $cache;
$cache->tidy();
}
/**
* Returns whether this cron task can run, given current board configuration.
*/
public function is_runnable()
{
global $cache;
return method_exists($cache, 'tidy');
}
/**
* Returns whether this cron task should run now, because enough time
* has passed since it was last run.
*/
public function should_run()
{
global $config;
return $config['cache_last_gc'] < time() - $config['cache_gc'];
}
}
|