]> git.mxchange.org Git - friendica.git/blob - include/cronjobs.php
it should be "gid" not "cid"
[friendica.git] / include / cronjobs.php
1 <?php
2 if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
3         $directory = dirname($_SERVER["argv"][0]);
4
5         if (substr($directory, 0, 1) != "/")
6                 $directory = $_SERVER["PWD"]."/".$directory;
7
8         $directory = realpath($directory."/..");
9
10         chdir($directory);
11 }
12
13 require_once("boot.php");
14
15
16 function cronjobs_run(&$argv, &$argc){
17         global $a, $db;
18
19         if(is_null($a)) {
20                 $a = new App;
21         }
22
23         if(is_null($db)) {
24                 @include(".htconfig.php");
25                 require_once("include/dba.php");
26                 $db = new dba($db_host, $db_user, $db_pass, $db_data);
27                 unset($db_host, $db_user, $db_pass, $db_data);
28         };
29
30         require_once('include/session.php');
31         require_once('include/datetime.php');
32         require_once('include/ostatus.php');
33         require_once('include/post_update.php');
34         require_once('mod/nodeinfo.php');
35
36         load_config('config');
37         load_config('system');
38
39         $a->set_baseurl(get_config('system','url'));
40
41         // No parameter set? So return
42         if ($argc <= 1)
43                 return;
44
45         // Check OStatus conversations
46         // Check only conversations with mentions (for a longer time)
47         if ($argv[1] == 'ostatus_mentions') {
48                 ostatus::check_conversations(true);
49                 return;
50         }
51
52         // Check every conversation
53         if ($argv[1] == 'ostatus_conversations') {
54                 ostatus::check_conversations(false);
55                 return;
56         }
57
58         // Call possible post update functions
59         // see include/post_update.php for more details
60         if ($argv[1] == 'post_update') {
61                 post_update();
62                 return;
63         }
64
65         // update nodeinfo data
66         if ($argv[1] == 'nodeinfo') {
67                 nodeinfo_cron();
68                 return;
69         }
70
71         return;
72 }
73
74 if (array_search(__file__,get_included_files())===0){
75         cronjobs_run($_SERVER["argv"],$_SERVER["argc"]);
76         killme();
77 }