Changeset 098c36e
- Timestamp:
- Sep 1, 2015, 7:30:46 PM (11 years ago)
- Branches:
- master
- Children:
- cf345ee
- Parents:
- ff873dc
- Location:
- src/webservice
- Files:
-
- 3 edited
-
htdocs/SiWeather/Webservice/Setup.php (modified) (1 diff)
-
htdocs/templates/setup.php (modified) (2 diffs)
-
tests/SetupTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/webservice/htdocs/SiWeather/Webservice/Setup.php
rff873dc r098c36e 326 326 327 327 # base_url needs to end with a /, otherwise the last element is chopped 328 $client = new \GuzzleHttp\Client 329 ( 330 [ 331 "base_uri" => $baseUrl, 332 "timeout" => 2.0, 333 "http_errors" => false, 334 ] 335 ); 336 $response = $client->get($url); 328 try{ 329 $client = new \GuzzleHttp\Client 330 ( 331 [ 332 "base_uri" => $baseUrl, 333 "timeout" => 2.0, 334 "http_errors" => false, 335 ] 336 ); 337 $response = $client->get($url); 338 } 339 catch(\GuzzleHttp\Exception\ConnectException $exception){ 340 $errorMessage = \Translator::swGettext("Webservce has not answered at url %s! Error: %s", $baseUrl, $exception->getMessage()); 341 return false; 342 } 337 343 if(is_null($response)){ 338 344 $errorMessage = \Translator::swGettext("Webservice has not answered at url %s!", $baseUrl); -
src/webservice/htdocs/templates/setup.php
rff873dc r098c36e 99 99 } 100 100 else{ 101 $url = $webserviceConfig-> getConfig("webserviceBaseUrl") ."index.php/";101 $url = $webserviceConfig->webserviceBaseUrl() ."index.php/"; 102 102 printResult(true, Translator::swGettext("Webservice withpout rewrite accessible at %s", "<a href=\"". $url ."\">". $url ."</a>")); 103 103 } … … 106 106 } 107 107 else{ 108 $url = $webserviceConfig-> getConfig("webserviceBaseUrl");108 $url = $webserviceConfig->webserviceBaseUrl(); 109 109 printResult(true, Translator::swGettext("Webservice withp rewrite accessible at %s", "<a href=\"". $url ."\">". $url ."</a>")); 110 110 } -
src/webservice/tests/SetupTest.php
rff873dc r098c36e 122 122 $this->assertLessThan($versionSpatalite, 0, $prefix ." (Could not determine Spatalite version: ". $errorMessage .")"); 123 123 $this->assertTrue(empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty"); 124 125 $result = $setup->apiCheckWithoutRewrite($errorMessage); 126 $this->assertTrue($result, $errorMessage); 124 127 } 125 128 … … 156 159 $this->assertLessThan($versionSpatalite, 0, $prefix ." (Could not determine Spatalite version: ". $errorMessage .")"); 157 160 $this->assertTrue(empty($errorMessage), "Error message \"". $errorMessage ."\" is not empty"); 161 162 $result = $setup->apiCheckWithoutRewrite($errorMessage); 163 $this->assertTrue($result, $errorMessage); 158 164 } 159 165
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)