Changeset 1e37648 for src/webservice/htdocs/SiWeather/Webservice/Setup.php
- Timestamp:
- Aug 28, 2015, 3:29:08 PM (11 years ago)
- Branches:
- master
- Children:
- b858e6f
- Parents:
- 851179e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/webservice/htdocs/SiWeather/Webservice/Setup.php
r851179e r1e37648 306 306 307 307 public function apiCheckWithRewrite(&$errorMessage){ 308 $apiVersion = $this->_webserviceConfig->getConfig("webserviceApiVersion"); 309 if(!$apiVersion || empty($apiVersion)){ 310 $errorMessage = _("Could not determine API version"); 311 return false; 312 } 313 314 return $this->apiCheck($apiVersion ."/stations", $errorMessage); 308 return $this->apiCheck("stations", $errorMessage); 315 309 } 316 310 … … 326 320 327 321 private function apiCheck($url, &$errorMessage){ 328 $baseUrl = $this->_webserviceConfig-> getConfig("webserviceBaseUrl");322 $baseUrl = $this->_webserviceConfig->webserviceBaseUrl(); 329 323 if(!$baseUrl || empty($baseUrl)){ 330 324 $errorMessage = _("No webservice base url given!"); … … 332 326 } 333 327 328 # base_url needs to end with a /, otherwise the last element is chopped 334 329 $client = new \GuzzleHttp\Client 335 330 ( … … 347 342 $result = $response->getStatusCode(); 348 343 if($result != 200){ 349 $errorMessage = \Translator::swGettext("Got http error %s (%s) ", $result, $response->getReasonPhrase());344 $errorMessage = \Translator::swGettext("Got http error %s (%s) at url %s", $result, $response->getReasonPhrase(), $baseUrl ."/". $url); 350 345 return false; 351 346 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/siweather/chrome/site/your_project_logo.png)