X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fcronhooks.php;h=15d49fe5474b32101c60ff5ba90b58c383f1ac39;hb=a410d9caaeaa53b693d8a13895171d5d7223cc15;hp=37541f013e97abbd9b912459f2b2d461abf8946f;hpb=aaf5a81365b4cbcb3d1b9537b5544aeb5de66f4b;p=friendica.git diff --git a/include/cronhooks.php b/include/cronhooks.php index 37541f013e..15d49fe547 100644 --- a/include/cronhooks.php +++ b/include/cronhooks.php @@ -3,7 +3,7 @@ require_once("boot.php"); -function cronhooks_run($argv, $argc){ +function cronhooks_run(&$argv, &$argc){ global $a, $db; if(is_null($a)) { @@ -12,17 +12,27 @@ function cronhooks_run($argv, $argc){ if(is_null($db)) { @include(".htconfig.php"); - require_once("dba.php"); + require_once("include/dba.php"); $db = new dba($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data); }; require_once('include/session.php'); require_once('include/datetime.php'); + require_once('include/pidfile.php'); load_config('config'); load_config('system'); + $lockpath = get_config('system','lockpath'); + if ($lockpath != '') { + $pidfile = new pidfile($lockpath, 'cron.lck'); + if($pidfile->is_already_running()) { + logger("cronhooks: Already running"); + exit; + } + } + $a->set_baseurl(get_config('system','url')); load_hooks();