X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdirectory.php;h=45386183c611c3fdce5470eeecdca1ef9df2fa6b;hb=dafc84390db4b57e5958f1af386c778b481c7d04;hp=2c9daa5ea6f3b025241a0a2d65f79bc734c417c1;hpb=5b35ceefb96f7122f210e2160c45bb4f8b9917b8;p=friendica.git diff --git a/include/directory.php b/include/directory.php index 2c9daa5ea6..45386183c6 100644 --- a/include/directory.php +++ b/include/directory.php @@ -2,24 +2,31 @@ require_once("boot.php"); function directory_run($argv, $argc){ - global $a, $db; + global $a, $db; - if(is_null($a)){ - $a = new App; - } + if(is_null($a)) { + $a = new App; + } - if(is_null($db)){ - @include(".htconfig.php"); - require_once("dba.php"); - $db = new dba($db_host, $db_user, $db_pass, $db_data); - unset($db_host, $db_user, $db_pass, $db_data); - }; + if(is_null($db)) { + @include(".htconfig.php"); + require_once("dba.php"); + $db = new dba($db_host, $db_user, $db_pass, $db_data); + unset($db_host, $db_user, $db_pass, $db_data); + }; + + load_config('config'); + load_config('system'); + if($argc != 2) return; load_config('system'); + load_hooks(); + + $a->set_baseurl(get_config('system','url')); $dir = get_config('system','directory_submit_url'); @@ -27,7 +34,12 @@ function directory_run($argv, $argc){ if(! strlen($dir)) return; - fetch_url($dir . '?url=' . bin2hex($argv[1])); + $arr = array('url' => $argv[1]); + + call_hooks('globaldir_update', $arr); + + if(strlen($arr['url'])) + fetch_url($dir . '?url=' . bin2hex($arr['url'])); return; }