3 use \Friendica\Core\Config;
5 function expire_run(&$argv, &$argc){
8 require_once('include/datetime.php');
9 require_once('include/items.php');
10 require_once('include/Contact.php');
12 // physically remove anything that has been deleted for more than two months
14 $r = q("DELETE FROM `item` WHERE `deleted` = 1 AND `changed` < UTC_TIMESTAMP() - INTERVAL 60 DAY");
16 // make this optional as it could have a performance impact on large sites
18 if (intval(get_config('system','optimize_items'))) {
19 q("OPTIMIZE TABLE `item`");
22 logger('expire: start');
24 $r = q("SELECT `uid`,`username`,`expire` FROM `user` WHERE `expire` != 0");
25 if (dbm::is_result($r)) {
27 logger('Expire: ' . $rr['username'] . ' interval: ' . $rr['expire'], LOGGER_DEBUG);
28 item_expire($rr['uid'],$rr['expire']);