aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/cron_tasks/standard/tidy_database.php
blob: 16a17b3538769ee8da59f6fd07fa9934f30d0703 (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
<?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 database cron task.
*
* @package phpBB3
*/
class tidy_database_cron_task extends cron_task_base
{
	/**
	* Runs this cron task.
	*/
	public function run()
	{
		include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
		tidy_database();
	}

	/**
	* 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['database_last_gc'] < time() - $config['database_gc'];
	}
}