-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
e_cron.php
49 lines (40 loc) · 885 Bytes
/
e_cron.php
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
<?php
/**
* @file
* Cron handler.
*/
if(!defined('e107_INIT'))
{
exit;
}
/**
* Class metatag_cron.
*/
class metatag_cron
{
function config()
{
$cron = array();
$cron[] = array(
// Displayed in admin area.
'name' => 'Purge expired cache.',
// Name of the function which is defined below.
'function' => 'metatag_cron_purge_expired_cache',
// Choose between: mail, user, content, notify, or backup.
'category' => 'content',
// Displayed in admin area.
'description' => 'Purge expired cache data from metatag_cache table.',
'tab' => '0 * * * *',
'active' => 1,
);
return $cron;
}
/**
* Purge expired cache data from metatag_cache table.
*/
public function metatag_cron_purge_expired_cache()
{
$sql = e107::getDb();
$sql->delete("metatag_cache", "expire > 0 AND expire <= UNIX_TIMESTAMP()");
}
}