X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fexpire.php;h=e3313a78be9583ed7a5520ee1fb54987e363e814;hb=df8b522f6b96bc3a631e608ee430555590e91f0c;hp=755cd2494b94ee108547c45898649d61966a9823;hpb=d92be9d93cc6a9b90572cd46e982e24f57c43ffc;p=friendica.git diff --git a/include/expire.php b/include/expire.php index 755cd2494b..e3313a78be 100644 --- a/include/expire.php +++ b/include/expire.php @@ -2,30 +2,28 @@ require_once("boot.php"); -function expire_run($argv, $argc){ +function expire_run(&$argv, &$argc){ global $a, $db; if(is_null($a)) { $a = new App; } - + if(is_null($db)) { @include(".htconfig.php"); - require_once("dba.php"); + require_once("include/dba.php"); $db = new dba($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data); }; require_once('include/session.php'); require_once('include/datetime.php'); - require_once('library/simplepie/simplepie.inc'); require_once('include/items.php'); require_once('include/Contact.php'); load_config('config'); load_config('system'); - $a->set_baseurl(get_config('system','url')); @@ -39,19 +37,23 @@ function expire_run($argv, $argc){ q("optimize table item"); logger('expire: start'); - + $r = q("SELECT `uid`,`username`,`expire` FROM `user` WHERE `expire` != 0"); - if(count($r)) { - foreach($r as $rr) { + if (dbm::is_result($r)) { + foreach ($r as $rr) { logger('Expire: ' . $rr['username'] . ' interval: ' . $rr['expire'], LOGGER_DEBUG); item_expire($rr['uid'],$rr['expire']); } } + load_hooks(); + + call_hooks('expire'); + return; } if (array_search(__file__,get_included_files())===0){ - expire_run($argv,$argc); + expire_run($_SERVER["argv"],$_SERVER["argc"]); killme(); }