aboutsummaryrefslogtreecommitdiffstats
path: root/include/directory.php
blob: f35cb4cb48da863ef25257feb9a71d8f007414fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
require_once('boot.php');
require_once('include/cli_startup.php');

function directory_run($argv, $argc){

	cli_startup();		 

	if(argc() != 2)
		return;

	$dir = get_config('system','directory_submit_url');

	if(! strlen($dir))
		return;

	$arr = array('url' => argv(1));

	call_hooks('globaldir_update', $arr);

	if(strlen($arr['url']))
		fetch_url($dir . '?url=' . bin2hex($arr['url']));

	return;
}

if (array_search(__file__,get_included_files())===0){
  directory_run($argv,$argc);
  killme();
}