@@ -232,8 +232,7 @@ discard block |
||
| 232 | 232 | $port=$_SERVER['SERVER_PORT']; |
| 233 | 233 | if(($port!=80 && !$secure) || ($port!=443 && $secure)) |
| 234 | 234 | $url.=':'.$port; |
| 235 | - } |
|
| 236 | - else |
|
| 235 | + } else |
|
| 237 | 236 | $url.=$_SERVER['HTTP_HOST']; |
| 238 | 237 | $url.=$this->getRequestUri(); |
| 239 | 238 | $this->_url=new TUri($url); |
@@ -341,8 +340,7 @@ discard block |
||
| 341 | 340 | { |
| 342 | 341 | $this->_urlManager=new TUrlManager; |
| 343 | 342 | $this->_urlManager->init(null); |
| 344 | - } |
|
| 345 | - else |
|
| 343 | + } else |
|
| 346 | 344 | { |
| 347 | 345 | $this->_urlManager=$this->getApplication()->getModule($this->_urlManagerID); |
| 348 | 346 | if($this->_urlManager===null) |
@@ -462,8 +460,7 @@ discard block |
||
| 462 | 460 | |
| 463 | 461 | if($result === null && function_exists('apache_request_headers')) { |
| 464 | 462 | $result = apache_request_headers(); |
| 465 | - } |
|
| 466 | - elseif($result === null) { |
|
| 463 | + } elseif($result === null) { |
|
| 467 | 464 | $result = array(); |
| 468 | 465 | foreach($_SERVER as $key=>$value) { |
| 469 | 466 | if(strncasecmp($key, 'HTTP_', 5) !== 0) continue; |
@@ -566,8 +563,7 @@ discard block |
||
| 566 | 563 | try |
| 567 | 564 | { |
| 568 | 565 | return get_browser(); |
| 569 | - } |
|
| 570 | - catch(TPhpErrorException $e) |
|
| 566 | + } catch(TPhpErrorException $e) |
|
| 571 | 567 | { |
| 572 | 568 | throw new TConfigurationException('httprequest_browscap_required'); |
| 573 | 569 | } |
@@ -670,8 +666,7 @@ discard block |
||
| 670 | 666 | if(($value=$sm->validateData($value))!==false) |
| 671 | 667 | $this->_cookies->add(new THttpCookie($key,$value)); |
| 672 | 668 | } |
| 673 | - } |
|
| 674 | - else |
|
| 669 | + } else |
|
| 675 | 670 | { |
| 676 | 671 | foreach($_COOKIE as $key=>$value) |
| 677 | 672 | $this->_cookies->add(new THttpCookie($key,$value)); |
@@ -888,8 +883,7 @@ discard block |
||
| 888 | 883 | $value=$this->_items[$key]; |
| 889 | 884 | unset($this->_items[$key]); |
| 890 | 885 | return $value; |
| 891 | - } |
|
| 892 | - else |
|
| 886 | + } else |
|
| 893 | 887 | return null; |
| 894 | 888 | } |
| 895 | 889 | |
@@ -239,8 +239,7 @@ discard block |
||
| 239 | 239 | $pageConfig->loadPageConfigurationFromXml($config,$application->getBasePath(),''); |
| 240 | 240 | } |
| 241 | 241 | $pageConfig->loadFromFiles($this->getBasePath()); |
| 242 | - } |
|
| 243 | - else |
|
| 242 | + } else |
|
| 244 | 243 | { |
| 245 | 244 | $configCached=true; |
| 246 | 245 | $currentTimestamp=array(); |
@@ -258,8 +257,7 @@ discard block |
||
| 258 | 257 | $currentTimestamp[0]=$appConfigFile===null?0:@filemtime($appConfigFile); |
| 259 | 258 | if($currentTimestamp[0]>$timestamp || ($timestamp>0 && !$currentTimestamp[0])) |
| 260 | 259 | $configCached=false; |
| 261 | - } |
|
| 262 | - else |
|
| 260 | + } else |
|
| 263 | 261 | { |
| 264 | 262 | $currentTimestamp[$fileName]=@filemtime($fileName); |
| 265 | 263 | if($currentTimestamp[$fileName]>$timestamp || ($timestamp>0 && !$currentTimestamp[$fileName])) |
@@ -267,8 +265,7 @@ discard block |
||
| 267 | 265 | } |
| 268 | 266 | } |
| 269 | 267 | } |
| 270 | - } |
|
| 271 | - else |
|
| 268 | + } else |
|
| 272 | 269 | { |
| 273 | 270 | $configCached=false; |
| 274 | 271 | $paths=explode('.',$pagePath); |
@@ -501,8 +498,7 @@ discard block |
||
| 501 | 498 | |
| 502 | 499 | if(!class_exists($className,false)) |
| 503 | 500 | $className = $namespacedClassName; |
| 504 | - } |
|
| 505 | - else |
|
| 501 | + } else |
|
| 506 | 502 | { |
| 507 | 503 | $className=$this->getBasePageClass(); |
| 508 | 504 | Prado::using($className); |
@@ -78,16 +78,13 @@ |
||
| 78 | 78 | )); |
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | - } |
|
| 82 | - catch(TRpcException $e) |
|
| 81 | + } catch(TRpcException $e) |
|
| 83 | 82 | { |
| 84 | 83 | return $this->createErrorResponse($e); |
| 85 | - } |
|
| 86 | - catch(THttpException $e) |
|
| 84 | + } catch(THttpException $e) |
|
| 87 | 85 | { |
| 88 | 86 | throw $e; |
| 89 | - } |
|
| 90 | - catch(\Exception $e) |
|
| 87 | + } catch(\Exception $e) |
|
| 91 | 88 | { |
| 92 | 89 | return $this->createErrorResponse(new TRpcException('An internal error occured', '-32603')); |
| 93 | 90 | } |
@@ -80,14 +80,12 @@ discard block |
||
| 80 | 80 | $server->setClass($providerClass, $this); |
| 81 | 81 | if($this->_persistent) |
| 82 | 82 | $server->setPersistence(SOAP_PERSISTENCE_SESSION); |
| 83 | - } |
|
| 84 | - else |
|
| 83 | + } else |
|
| 85 | 84 | $server=$this->createServer(); |
| 86 | 85 | try |
| 87 | 86 | { |
| 88 | 87 | $server->handle(); |
| 89 | - } |
|
| 90 | - catch (\Exception $e) |
|
| 88 | + } catch (\Exception $e) |
|
| 91 | 89 | { |
| 92 | 90 | if($this->getApplication()->getMode()===TApplicationMode::Debug) |
| 93 | 91 | $this->fault($e->getMessage(), $e->__toString()); |
@@ -199,13 +197,11 @@ discard block |
||
| 199 | 197 | $wsdl=WsdlGenerator::generate($providerClass, $this->getUri(), $this->getEncoding()); |
| 200 | 198 | $cache->set(self::WSDL_CACHE_PREFIX.$providerClass,$wsdl); |
| 201 | 199 | return $wsdl; |
| 202 | - } |
|
| 203 | - else |
|
| 200 | + } else |
|
| 204 | 201 | { |
| 205 | 202 | return WsdlGenerator::generate($providerClass, $this->getUri(), $this->getEncoding()); |
| 206 | 203 | } |
| 207 | - } |
|
| 208 | - else |
|
| 204 | + } else |
|
| 209 | 205 | return file_get_contents($this->_wsdlUri); |
| 210 | 206 | } |
| 211 | 207 | |
@@ -72,16 +72,13 @@ |
||
| 72 | 72 | try |
| 73 | 73 | { |
| 74 | 74 | return xmlrpc_server_call_method($this->_xmlrpcServer, $requestPayload, null); |
| 75 | - } |
|
| 76 | - catch(TRpcException $e) |
|
| 75 | + } catch(TRpcException $e) |
|
| 77 | 76 | { |
| 78 | 77 | return $this->createErrorResponse($e); |
| 79 | - } |
|
| 80 | - catch(THttpException $e) |
|
| 78 | + } catch(THttpException $e) |
|
| 81 | 79 | { |
| 82 | 80 | throw $e; |
| 83 | - } |
|
| 84 | - catch(\Exception $e) |
|
| 81 | + } catch(\Exception $e) |
|
| 85 | 82 | { |
| 86 | 83 | return $this->createErrorResponse(new TRpcException('An internal error occured')); |
| 87 | 84 | } |
@@ -69,8 +69,7 @@ |
||
| 69 | 69 | try |
| 70 | 70 | { |
| 71 | 71 | return $this->handler->callMethod($this->getPayload()); |
| 72 | - } |
|
| 73 | - catch(TRpcException $e) |
|
| 72 | + } catch(TRpcException $e) |
|
| 74 | 73 | { |
| 75 | 74 | return $this->handler->createErrorResponse($e); |
| 76 | 75 | } |
@@ -79,8 +79,7 @@ discard block |
||
| 79 | 79 | foreach($config as $id => $feed) |
| 80 | 80 | $this->_feeds[$id] = $feed; |
| 81 | 81 | } |
| 82 | - } |
|
| 83 | - else |
|
| 82 | + } else |
|
| 84 | 83 | { |
| 85 | 84 | foreach($config->getElementsByTagName('feed') as $feed) |
| 86 | 85 | { |
@@ -121,11 +120,9 @@ discard block |
||
| 121 | 120 | $properties=isset($feedConfig['properties'])?$feedConfig['properties']:array(); |
| 122 | 121 | else |
| 123 | 122 | throw new TConfigurationException('jsonservice_response_type_invalid',$id); |
| 124 | - } |
|
| 125 | - else |
|
| 123 | + } else |
|
| 126 | 124 | throw new TConfigurationException('jsonservice_class_required',$id); |
| 127 | - } |
|
| 128 | - else |
|
| 125 | + } else |
|
| 129 | 126 | { |
| 130 | 127 | $properties=$feedConfig->getAttributes(); |
| 131 | 128 | if(($class=$properties->remove('class'))!==null) |
@@ -133,8 +130,7 @@ discard block |
||
| 133 | 130 | $feed=Prado::createComponent($class); |
| 134 | 131 | if(!($feed instanceof IFeedContentProvider)) |
| 135 | 132 | throw new TConfigurationException('feedservice_feedtype_invalid',$id); |
| 136 | - } |
|
| 137 | - else |
|
| 133 | + } else |
|
| 138 | 134 | throw new TConfigurationException('feedservice_class_required',$id); |
| 139 | 135 | } |
| 140 | 136 | |
@@ -147,8 +143,7 @@ discard block |
||
| 147 | 143 | //$this->getResponse()->setContentType('application/rss+xml'); |
| 148 | 144 | $this->getResponse()->setContentType($feed->getContentType()); |
| 149 | 145 | $this->getResponse()->write($content); |
| 150 | - } |
|
| 151 | - else |
|
| 146 | + } else |
|
| 152 | 147 | throw new THttpException(404,'feedservice_feed_unknown',$id); |
| 153 | 148 | } |
| 154 | 149 | } |
| 155 | 150 | \ No newline at end of file |
@@ -363,10 +363,10 @@ discard block |
||
| 363 | 363 | $params=explode('/',$matches['urlparams']); |
| 364 | 364 | if ($this->_separator==='/') |
| 365 | 365 | { |
| 366 | - while($key=array_shift($params)) |
|
| 367 | - $matches[$key]=($value=array_shift($params)) ? $value : ''; |
|
| 368 | - } |
|
| 369 | - else |
|
| 366 | + while($key=array_shift($params)) { |
|
| 367 | + $matches[$key]=($value=array_shift($params)) ? $value : ''; |
|
| 368 | + } |
|
| 369 | + } else |
|
| 370 | 370 | { |
| 371 | 371 | array_pop($params); |
| 372 | 372 | foreach($params as $param) |
@@ -558,12 +558,10 @@ discard block |
||
| 558 | 558 | $name=rawurlencode($name.'[]'); |
| 559 | 559 | foreach($value as $v) |
| 560 | 560 | $url2.=$amp.$name.'='.rawurlencode($v); |
| 561 | - } |
|
| 562 | - else |
|
| 561 | + } else |
|
| 563 | 562 | $url2.=$amp.rawurlencode($name).'='.rawurlencode($value); |
| 564 | 563 | } |
| 565 | - } |
|
| 566 | - else |
|
| 564 | + } else |
|
| 567 | 565 | { |
| 568 | 566 | foreach($extra as $name=>$value) |
| 569 | 567 | { |
@@ -571,8 +569,7 @@ discard block |
||
| 571 | 569 | { |
| 572 | 570 | foreach($value as $v) |
| 573 | 571 | $url2.=$amp.$name.'[]='.$v; |
| 574 | - } |
|
| 575 | - else |
|
| 572 | + } else |
|
| 576 | 573 | $url2.=$amp.$name.'='.$value; |
| 577 | 574 | } |
| 578 | 575 | } |
@@ -136,15 +136,13 @@ discard block |
||
| 136 | 136 | { |
| 137 | 137 | $config = include $this->_configFile; |
| 138 | 138 | $this->loadUrlMappings($dom); |
| 139 | - } |
|
| 140 | - else |
|
| 139 | + } else |
|
| 141 | 140 | { |
| 142 | 141 | $dom=new TXmlDocument; |
| 143 | 142 | $dom->loadFromFile($this->_configFile); |
| 144 | 143 | $this->loadUrlMappings($dom); |
| 145 | 144 | } |
| 146 | - } |
|
| 147 | - else |
|
| 145 | + } else |
|
| 148 | 146 | throw new TConfigurationException('urlmapping_configfile_inexistent',$this->_configFile); |
| 149 | 147 | } |
| 150 | 148 | |
@@ -251,8 +249,7 @@ discard block |
||
| 251 | 249 | $this->buildUrlMapping($class,$properties,$url); |
| 252 | 250 | } |
| 253 | 251 | } |
| 254 | - } |
|
| 255 | - else |
|
| 252 | + } else |
|
| 256 | 253 | { |
| 257 | 254 | foreach($config->getElementsByTagName('url') as $url) |
| 258 | 255 | { |
@@ -366,8 +363,7 @@ discard block |
||
| 366 | 363 | if($rule->supportCustomUrl($getItems)) |
| 367 | 364 | return $rule->constructUrl($getItems,$encodeAmpersand,$encodeGetItems); |
| 368 | 365 | } |
| 369 | - } |
|
| 370 | - elseif(isset($this->_constructRules[$wildCardKey])) |
|
| 366 | + } elseif(isset($this->_constructRules[$wildCardKey])) |
|
| 371 | 367 | { |
| 372 | 368 | foreach($this->_constructRules[$wildCardKey] as $rule) |
| 373 | 369 | { |