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