2010-08-19 11:59:31 +00:00
|
|
|
<?php
|
2011-01-28 13:04:18 +00:00
|
|
|
require_once("boot.php");
|
|
|
|
|
2012-11-05 08:28:54 +00:00
|
|
|
function directory_run(&$argv, &$argc){
|
2011-06-30 08:15:18 +00:00
|
|
|
global $a, $db;
|
2011-01-28 13:04:18 +00:00
|
|
|
|
2011-06-30 08:15:18 +00:00
|
|
|
if(is_null($a)) {
|
|
|
|
$a = new App;
|
|
|
|
}
|
2015-09-15 20:29:02 +00:00
|
|
|
|
2011-06-30 08:15:18 +00:00
|
|
|
if(is_null($db)) {
|
|
|
|
@include(".htconfig.php");
|
2012-12-28 21:51:50 +00:00
|
|
|
require_once("include/dba.php");
|
2011-06-30 08:15:18 +00:00
|
|
|
$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 11:59:31 +00:00
|
|
|
|
|
|
|
if($argc != 2)
|
2011-01-24 21:01:56 +00:00
|
|
|
return;
|
2010-08-19 11:59:31 +00:00
|
|
|
|
|
|
|
load_config('system');
|
|
|
|
|
2012-05-21 23:40:11 +00:00
|
|
|
load_hooks();
|
|
|
|
|
|
|
|
|
2010-08-19 11:59:31 +00:00
|
|
|
$a->set_baseurl(get_config('system','url'));
|
|
|
|
|
2015-09-15 20:29:02 +00:00
|
|
|
$dir = get_config('system','directory');
|
2010-08-19 11:59:31 +00:00
|
|
|
|
|
|
|
if(! strlen($dir))
|
2011-01-28 13:04:18 +00:00
|
|
|
return;
|
2010-08-19 11:59:31 +00:00
|
|
|
|
2015-09-15 20:29:02 +00:00
|
|
|
$dir .= "/submit";
|
|
|
|
|
2012-05-21 23:40:11 +00:00
|
|
|
$arr = array('url' => $argv[1]);
|
|
|
|
|
|
|
|
call_hooks('globaldir_update', $arr);
|
|
|
|
|
2012-11-19 06:53:01 +00:00
|
|
|
logger('Updating directory: ' . $arr['url'], LOGGER_DEBUG);
|
2012-05-21 23:40:11 +00:00
|
|
|
if(strlen($arr['url']))
|
|
|
|
fetch_url($dir . '?url=' . bin2hex($arr['url']));
|
2010-08-19 11:59:31 +00:00
|
|
|
|
2011-01-24 21:01:56 +00:00
|
|
|
return;
|
2011-01-28 13:04:18 +00:00
|
|
|
}
|
2010-08-19 11:59:31 +00:00
|
|
|
|
2011-01-28 13:04:18 +00:00
|
|
|
if (array_search(__file__,get_included_files())===0){
|
2015-01-04 12:24:16 +00:00
|
|
|
directory_run($_SERVER["argv"],$_SERVER["argc"]);
|
2011-01-28 13:04:18 +00:00
|
|
|
killme();
|
|
|
|
}
|