X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fcronhooks.php;h=bea0f6a198a13121fc9df746b5e8db8cf8b3eddf;hb=fdcb6d3c6f785ea588f3ce7db2659764032c114d;hp=4bb1e5f65960b3b3c1bbad1077d34628388040b0;hpb=ae905cbd1b67b2aeae33a64302368d285f63732d;p=friendica.git diff --git a/include/cronhooks.php b/include/cronhooks.php index 4bb1e5f659..bea0f6a198 100644 --- a/include/cronhooks.php +++ b/include/cronhooks.php @@ -1,38 +1,12 @@ hooks) AND array_key_exists("cron", $a->hooks)) { foreach ($a->hooks["cron"] as $hook) if ($hook[1] == $argv[1]) { @@ -42,7 +16,7 @@ function cronhooks_run(&$argv, &$argc){ return; } - $last = get_config('system','last_cronhook'); + $last = get_config('system', 'last_cronhook'); $poll_interval = intval(get_config('system','cronhook_interval')); if(! $poll_interval) @@ -62,22 +36,16 @@ function cronhooks_run(&$argv, &$argc){ $d = datetime_convert(); - if (get_config("system", "worker") AND is_array($a->hooks) AND array_key_exists("cron", $a->hooks)) { + if (is_array($a->hooks) AND array_key_exists("cron", $a->hooks)) { foreach ($a->hooks["cron"] as $hook) { logger("Calling cronhooks for '".$hook[1]."'", LOGGER_DEBUG); proc_run(PRIORITY_MEDIUM, "include/cronhooks.php", $hook[1]); } - } else - call_hooks('cron', $d); + } logger('cronhooks: end'); - set_config('system','last_cronhook', time()); + set_config('system', 'last_cronhook', time()); return; } - -if (array_search(__file__,get_included_files())===0){ - cronhooks_run($_SERVER["argv"],$_SERVER["argc"]); - killme(); -}