]> git.mxchange.org Git - friendica.git/blob - include/expire.php
Merge pull request #163 from fabrixxm/master
[friendica.git] / include / expire.php
1 <?php
2
3 require_once("boot.php");
4
5 function expire_run($argv, $argc){
6         global $a, $db;
7
8         if(is_null($a)) {
9                 $a = new App;
10         }
11   
12         if(is_null($db)) {
13             @include(".htconfig.php");
14         require_once("dba.php");
15             $db = new dba($db_host, $db_user, $db_pass, $db_data);
16         unset($db_host, $db_user, $db_pass, $db_data);
17         };
18
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');
24
25         load_config('config');
26         load_config('system');
27
28
29         $a->set_baseurl(get_config('system','url'));
30
31
32         logger('expire: start');
33         
34         $r = q("SELECT `uid`,`username`,`expire` FROM `user` WHERE `expire` != 0");
35         if(count($r)) {
36                 foreach($r as $rr) {
37                         logger('Expire: ' . $rr['username'] . ' interval: ' . $rr['expire'], LOGGER_DEBUG);
38                         item_expire($rr['uid'],$rr['expire']);
39                 }
40         }
41
42         return;
43 }
44
45 if (array_search(__file__,get_included_files())===0){
46   expire_run($argv,$argc);
47   killme();
48 }