2010-08-19 07:59:31 -04:00
|
|
|
<?php
|
2011-01-28 08:04:18 -05:00
|
|
|
require_once("boot.php");
|
|
|
|
|
2012-11-05 03:28:54 -05:00
|
|
|
function directory_run(&$argv, &$argc){
|
2011-06-30 04:15:18 -04:00
|
|
|
global $a, $db;
|
2011-01-28 08:04:18 -05:00
|
|
|
|
2011-06-30 04:15:18 -04:00
|
|
|
if(is_null($a)) {
|
|
|
|
$a = new App;
|
|
|
|
}
|
2011-01-28 08:04:18 -05:00
|
|
|
|
2011-06-30 04:15:18 -04:00
|
|
|
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');
|
|
|
|
|
2010-08-19 07:59:31 -04:00
|
|
|
|
|
|
|
if($argc != 2)
|
2011-01-24 16:01:56 -05:00
|
|
|
return;
|
2010-08-19 07:59:31 -04:00
|
|
|
|
|
|
|
load_config('system');
|
|
|
|
|
2012-05-21 19:40:11 -04:00
|
|
|
load_hooks();
|
|
|
|
|
|
|
|
|
2010-08-19 07:59:31 -04:00
|
|
|
$a->set_baseurl(get_config('system','url'));
|
|
|
|
|
|
|
|
$dir = get_config('system','directory_submit_url');
|
|
|
|
|
|
|
|
if(! strlen($dir))
|
2011-01-28 08:04:18 -05:00
|
|
|
return;
|
2010-08-19 07:59:31 -04:00
|
|
|
|
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);
|
2012-05-21 19:40:11 -04:00
|
|
|
if(strlen($arr['url']))
|
|
|
|
fetch_url($dir . '?url=' . bin2hex($arr['url']));
|
2010-08-19 07:59:31 -04:00
|
|
|
|
2011-01-24 16:01:56 -05:00
|
|
|
return;
|
2011-01-28 08:04:18 -05:00
|
|
|
}
|
2010-08-19 07:59:31 -04:00
|
|
|
|
2011-01-28 08:04:18 -05:00
|
|
|
if (array_search(__file__,get_included_files())===0){
|
|
|
|
directory_run($argv,$argc);
|
|
|
|
killme();
|
|
|
|
}
|