3 require_once("boot.php");
5 function expire_run(&$argv, &$argc){
13 @include(".htconfig.php");
14 require_once("include/dba.php");
15 $db = new dba($db_host, $db_user, $db_pass, $db_data);
16 unset($db_host, $db_user, $db_pass, $db_data);
19 require_once('include/session.php');
20 require_once('include/datetime.php');
21 require_once('library/simplepie/simplepie.inc');
22 require_once('include/items.php');
23 require_once('include/Contact.php');
25 load_config('config');
26 load_config('system');
28 $a->set_baseurl(get_config('system','url'));
31 // physically remove anything that has been deleted for more than two months
33 $r = q("delete from item where deleted = 1 and changed < UTC_TIMESTAMP() - INTERVAL 60 DAY");
35 // make this optional as it could have a performance impact on large sites
37 if(intval(get_config('system','optimize_items')))
38 q("optimize table item");
40 logger('expire: start');
42 $r = q("SELECT `uid`,`username`,`expire` FROM `user` WHERE `expire` != 0");
45 logger('Expire: ' . $rr['username'] . ' interval: ' . $rr['expire'], LOGGER_DEBUG);
46 item_expire($rr['uid'],$rr['expire']);
57 if (array_search(__file__,get_included_files())===0){
58 expire_run($_SERVER["argv"],$_SERVER["argc"]);