You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
534 B
29 lines
534 B
<?php |
|
|
|
ini_set("ERROR_REPORTING", 0); |
|
include_once('lib/parser2/dojo2.inc'); |
|
$allfiles = @dojo_get_files(); |
|
|
|
if($argc || !empty($_GET['f'])){ |
|
|
|
$argfile = empty($_GET['f']) ? $argv[1] : $_GET['f']; |
|
|
|
$parts = explode("/", $argfile); |
|
$ns = array_shift($parts); |
|
$file = implode("/", $parts); |
|
|
|
try{ |
|
$data = @dojo_get_contents($ns, $file); |
|
}catch (Exception $e){ |
|
$data = array( |
|
"success" => False, |
|
"error" => $e |
|
); |
|
} |
|
|
|
if(!empty($_GET['f'])){ |
|
header("Content-type: application/json"); |
|
} |
|
|
|
print json_encode($data); |
|
}
|
|
|