Commit f2fdd679c121ae520e62fac8c59ca635933131f1
1 parent
a394ee09
Exists in
master
and in
110 other branches
fix php warnings
Showing
2 changed files
with
21 additions
and
26 deletions
Show diff stats
php/classes/UserMgr.php
php/classes/WebServer.php
... | ... | @@ -197,9 +197,10 @@ class WebServer |
197 | 197 | |
198 | 198 | protected function initUserMgr() |
199 | 199 | { |
200 | - if (isset($this->wsUserMgr)) | |
200 | + if (isset($this->wsUserMgr)) { | |
201 | 201 | return array('success' => true); |
202 | - $this->wsUserMgr = new WSUserMgr(); | |
202 | + } | |
203 | + $this->wsUserMgr = new WSUserMgr($this->userID, $this->userPWD, $this->sessionID); | |
203 | 204 | $this->wsUserMgr->init($this->userID, $this->userPWD, $this->sessionID, $this->isSoap); |
204 | 205 | |
205 | 206 | return array('success' => true); |
... | ... | @@ -351,7 +352,7 @@ class WebServer |
351 | 352 | $dom->save($locParamResult); |
352 | 353 | } |
353 | 354 | // if (!copy($remoteParamSrc,$remoteParamResult)) |
354 | -// $remoteParamResult = ''; | |
355 | +// $remoteParamResult = ''; | |
355 | 356 | if (!copy($wsParamSrc, $wsParamResult)) |
356 | 357 | $wsParamResult = ''; |
357 | 358 | |
... | ... | @@ -533,7 +534,7 @@ class WebServer |
533 | 534 | $dom->save($locParamResult); |
534 | 535 | } |
535 | 536 | // if (!copy($remoteParamSrc,$remoteParamResult)) |
536 | -// $remoteParamResult = ''; | |
537 | +// $remoteParamResult = ''; | |
537 | 538 | if (!copy($wsParamSrc, $wsParamResult)) |
538 | 539 | $wsParamResult = ''; |
539 | 540 | |
... | ... | @@ -596,33 +597,27 @@ class WebServer |
596 | 597 | array_push($paramId, $vars["parameterID"]); |
597 | 598 | // $paramId[] = $vars["parameterID"]; |
598 | 599 | |
599 | - if (!$vars["timeFormat"]) | |
600 | - $timeFormat = "ISO8601"; | |
601 | - else | |
602 | - $timeFormat = $vars["timeFormat"]; | |
603 | - | |
604 | - if (!$vars["gzip"]) | |
605 | - $gzip = 0; | |
606 | - else | |
607 | - $gzip = $vars["gzip"]; | |
608 | - /* | |
609 | - if (!$vars["stream"]) | |
610 | - $stream = 0; | |
611 | - else | |
612 | - $stream = $vars["stream"];*/ | |
600 | + $sampling = key_exists("sampling", $vars) ? $vars["sampling"] : false; | |
601 | + $gzip = key_exists("gzip", $vars) ? $vars["gzip"] : 0; | |
602 | + $outputFormat = key_exists("outputFormat", $vars) ? $vars["outputFormat"] : false; | |
603 | + $timeFormat = key_exists("timeFormat", $vars) ? $vars["timeFormat"] : "ISO8601"; | |
604 | + $stream = key_exists("stream", $vars) ? $vars["stream"] : 0; | |
613 | 605 | |
614 | 606 | $res = $this->doDownloadRequest( |
615 | - array("startTime" => $vars["startTime"], "stopTime" => $vars["stopTime"], "sampling" => $vars["sampling"]), | |
607 | + array("startTime" => $vars["startTime"], "stopTime" => $vars["stopTime"], "sampling" => $sampling), | |
616 | 608 | array("params" => $paramId), |
617 | 609 | array("userName" => $this->userID, "userPwd" => $this->userPWD, "sessionID" => $this->sessionID), |
618 | - array("format" => $vars["outputFormat"], "timeFormat" => $timeFormat, "gzip" => $gzip, "stream" => $stream), | |
610 | + array("format" => $outputFormat, "timeFormat" => $timeFormat, "gzip" => $gzip, "stream" => $stream), | |
619 | 611 | $dataFileName); |
620 | 612 | |
621 | - | |
622 | - if ($res['success']) return $res; | |
623 | - else { | |
624 | - if ($this->isSoap) throw new SoapFault("request03", $res['message']); | |
625 | - else return array('success' => false, 'message' => $res['message']); | |
613 | + if ($res['success']) { | |
614 | + return $res; | |
615 | + } else { | |
616 | + if ($this->isSoap) { | |
617 | + throw new SoapFault("request03", $res['message']); | |
618 | + } else { | |
619 | + return array('success' => false, 'message' => $res['message']); | |
620 | + } | |
626 | 621 | } |
627 | 622 | } |
628 | 623 | ... | ... |