webAlias); $replace = array("_" => "-"); // $dataSet = strtr($_GET['id'], $replace); $referXML = baseDir."DDsys.xml"; $DDsys = new DOMDocument("1.0"); $DDsys->load($referXML); $VIs = $DDsys->getElementsByTagName("VI"); $main = array(); $index = array(); foreach ( $VIs as $VI ) { if ($VI->getElementsByTagName("NAME")->item(0)->getAttribute('base') == "LOCAL") { $id = $VI->getElementsByTagName("NAME")->item(0)->nodeValue; $location = $VI->getElementsByTagName("LOCATION")->item(0)->nodeValue; $times = $VI->getElementsByTagName("TIMES")->item(0)->nodeValue; if (!file_exists($location.$times)) continue; $index[strtr($id,$replace)] = substr($location.$times,strlen(baseDir)); } } $main[webAlias] = $index; $json = json_encode($main); file_put_contents("../GRANULES/allDatasets.json", $json); exit($json); ?>