load(getenv('USER_DATA_PATH').'base.xml'); $vi = $dom->getElementById($argv[1]); $requestStart = (int)$argv[2]; $requestStop = (int)$argv[3]; $argumentsByParam = array(); if ($vi->getAttribute("moreData")) { $masks = $vi->getElementsByTagName('mask'); $mask = $masks->item(0)->nodeValue; $isSimu = strncmp($mask, "impex___", 8) === 0 || strncmp($mask, "spase___", 8) === 0; $isClWeb = strncmp($mask, "CLWEB_", 6) === 0; if ($isSimu) $myParamMgr = new SimuParamMgr(); else if ($isClWeb) $myParamMgr = new WsrParamMgr(); else exit(); $paramBuilder = new ParamBuilder(); $paramDom = new DomDocument("1.0"); $paramDom->load(getenv('USER_WS_PATH').'WsParams.xml'); $xpdSimu = new domxpath($paramDom); $paramsSimu = $xpdSimu->query("//*[@mask='".$mask."']"); $simuID = $paramsSimu->item(0)->getAttribute('xml:id'); $files = $vi->getElementsByTagName('file'); $param = $vi->getElementsByTagName('param')->item(0)->nodeValue; $args = $vi->getElementsByTagName('arguments'); if ($args->item(0)){ if ($args->item(0)->hasChildNodes()){ $arguments = array(); foreach ($args->item(0)->childNodes as $child){ if ($child instanceof DOMElement){ $arguments[$child->nodeName] = $child->nodeValue; } } $argumentsByParam[$param] = $arguments; } } $myBaseManager = new BaseManager(); $intervalsToGet = $myBaseManager->intervalsToGet($requestStart, $requestStop, $mask); $start = $intervalsToGet['start']; $stop = $intervalsToGet['stop']; // Data to get if (count($start) > 0) { for ($i = 0; $i < count($start); $i++) { $startD = gmdate("Y-m-d\TH:i:s\Z",$start[$i]); $stopD = gmdate("Y-m-d\TH:i:s\Z",$stop[$i]); if ($isClWeb) { $data['paramID'] = $param; $data['startDate'] = $startD; $data['stopDate'] = $stopD; $myParamMgr->setParams($data); $wsrFileNames = $myParamMgr->getData(); } else { $myParamMgr->setParams($param, $startD, $stopD, $argumentsByParam); $simuFileNames = $myParamMgr->getSimuData(); } } $paramBuilder->makeWsdParam($simuID); } } exit(); ?>