3 require_once("boot.php");
6 function cronhooks_run(&$argv, &$argc){
14 @include(".htconfig.php");
15 require_once("include/dba.php");
16 $db = new dba($db_host, $db_user, $db_pass, $db_data);
17 unset($db_host, $db_user, $db_pass, $db_data);
20 require_once('include/session.php');
21 require_once('include/datetime.php');
23 load_config('config');
24 load_config('system');
26 // Don't check this stuff if the function is called by the poller
27 if (App::callstack() != "poller_run") {
28 if (App::maxload_reached())
30 if (App::is_already_running('cronhooks', 'include/cronhooks.php', 1140))
34 $last = get_config('system','last_cronhook');
36 $poll_interval = intval(get_config('system','cronhook_interval'));
41 $next = $last + ($poll_interval * 60);
43 logger('cronhook intervall not reached');
48 $a->set_baseurl(get_config('system','url'));
52 logger('cronhooks: start');
54 $d = datetime_convert();
56 call_hooks('cron', $d);
58 logger('cronhooks: end');
60 set_config('system','last_cronhook', time());
65 if (array_search(__file__,get_included_files())===0){
66 cronhooks_run($_SERVER["argv"],$_SERVER["argc"]);