2010-08-19 07:59:31 -04:00
|
|
|
<?php
|
2017-01-18 16:45:32 -05:00
|
|
|
use \Friendica\Core\Config;
|
|
|
|
|
2012-11-05 03:28:54 -05:00
|
|
|
function directory_run(&$argv, &$argc){
|
2017-02-26 18:16:49 -05:00
|
|
|
if ($argc != 2) {
|
2011-01-24 16:01:56 -05:00
|
|
|
return;
|
2017-02-26 18:16:49 -05:00
|
|
|
}
|
2010-08-19 07:59:31 -04:00
|
|
|
|
2015-09-15 16:29:02 -04:00
|
|
|
$dir = get_config('system','directory');
|
2010-08-19 07:59:31 -04:00
|
|
|
|
2017-02-26 18:16:49 -05:00
|
|
|
if (!strlen($dir)) {
|
2011-01-28 08:04:18 -05:00
|
|
|
return;
|
2017-02-26 18:16:49 -05:00
|
|
|
}
|
2010-08-19 07:59:31 -04:00
|
|
|
|
2015-09-15 16:29:02 -04:00
|
|
|
$dir .= "/submit";
|
|
|
|
|
2012-05-21 19:40:11 -04:00
|
|
|
$arr = array('url' => $argv[1]);
|
|
|
|
|
|
|
|
call_hooks('globaldir_update', $arr);
|
|
|
|
|
2012-11-19 01:53:01 -05:00
|
|
|
logger('Updating directory: ' . $arr['url'], LOGGER_DEBUG);
|
2017-02-26 18:16:49 -05:00
|
|
|
if (strlen($arr['url'])) {
|
2012-05-21 19:40:11 -04:00
|
|
|
fetch_url($dir . '?url=' . bin2hex($arr['url']));
|
2017-02-26 18:16:49 -05:00
|
|
|
}
|
2011-01-24 16:01:56 -05:00
|
|
|
return;
|
2011-01-28 08:04:18 -05:00
|
|
|
}
|