aboutsummaryrefslogtreecommitdiffstats
path: root/include/importdoc.php
blob: 7c65037d3ffdeded4827f431e824dc80ee1d21fb (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
31
32
33
34
35
36
37
38
39
40
41
<?php



require_once('include/cli_startup.php');


function importdoc_run($argc,$argv){

	cli_startup();

	require_once('include/help.php');


	update_docs_dir('doc/*');

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

function update_docs_dir($s) {
	$f = basename($s);
	$d = dirname($s);
	if($s === 'doc/html')
		return;
	$files = glob("$d/$f");
	if($files) {
		foreach($files as $fi) {
			if($fi === 'doc/html')
				continue;
			if(is_dir($fi))
				update_docs_dir("$fi/*");
			else
				store_doc_file($fi);
		}
	}
}