3 use \Friendica\Core\Config;
5 function cronhooks_run(&$argv, &$argc){
8 require_once('include/datetime.php');
10 if (($argc == 2) AND is_array($a->hooks) AND array_key_exists("cron", $a->hooks)) {
11 foreach ($a->hooks["cron"] as $hook)
12 if ($hook[1] == $argv[1]) {
13 logger("Calling cron hook '".$hook[1]."'", LOGGER_DEBUG);
14 call_single_hook($a, $name, $hook, $data);
19 $last = get_config('system', 'last_cronhook');
21 $poll_interval = intval(get_config('system','cronhook_interval'));
26 $next = $last + ($poll_interval * 60);
28 logger('cronhook intervall not reached');
33 $a->set_baseurl(get_config('system','url'));
35 logger('cronhooks: start');
37 $d = datetime_convert();
39 if (is_array($a->hooks) AND array_key_exists("cron", $a->hooks)) {
40 foreach ($a->hooks["cron"] as $hook) {
41 logger("Calling cronhooks for '".$hook[1]."'", LOGGER_DEBUG);
42 proc_run(PRIORITY_MEDIUM, "include/cronhooks.php", $hook[1]);
46 logger('cronhooks: end');
48 set_config('system', 'last_cronhook', time());