@@ -224,8 +224,7 @@ discard block |
||
| 224 | 224 | $port=$_SERVER['SERVER_PORT']; |
| 225 | 225 | if(($port!=80 && !$secure) || ($port!=443 && $secure)) |
| 226 | 226 | $url.=':'.$port; |
| 227 | - } |
|
| 228 | - else |
|
| 227 | + } else |
|
| 229 | 228 | $url.=$_SERVER['HTTP_HOST']; |
| 230 | 229 | $url.=$this->getRequestUri(); |
| 231 | 230 | $this->_url=new TUri($url); |
@@ -333,8 +332,7 @@ discard block |
||
| 333 | 332 | { |
| 334 | 333 | $this->_urlManager=new TUrlManager; |
| 335 | 334 | $this->_urlManager->init(null); |
| 336 | - } |
|
| 337 | - else |
|
| 335 | + } else |
|
| 338 | 336 | { |
| 339 | 337 | $this->_urlManager=$this->getApplication()->getModule($this->_urlManagerID); |
| 340 | 338 | if($this->_urlManager===null) |
@@ -454,8 +452,7 @@ discard block |
||
| 454 | 452 | |
| 455 | 453 | if($result === null && function_exists('apache_request_headers')) { |
| 456 | 454 | $result = apache_request_headers(); |
| 457 | - } |
|
| 458 | - elseif($result === null) { |
|
| 455 | + } elseif($result === null) { |
|
| 459 | 456 | $result = array(); |
| 460 | 457 | foreach($_SERVER as $key=>$value) { |
| 461 | 458 | if(strncasecmp($key, 'HTTP_', 5) !== 0) continue; |
@@ -558,8 +555,7 @@ discard block |
||
| 558 | 555 | try |
| 559 | 556 | { |
| 560 | 557 | return get_browser(); |
| 561 | - } |
|
| 562 | - catch(TPhpErrorException $e) |
|
| 558 | + } catch(TPhpErrorException $e) |
|
| 563 | 559 | { |
| 564 | 560 | throw new TConfigurationException('httprequest_browscap_required'); |
| 565 | 561 | } |
@@ -662,8 +658,7 @@ discard block |
||
| 662 | 658 | if(($value=$sm->validateData($value))!==false) |
| 663 | 659 | $this->_cookies->add(new THttpCookie($key,$value)); |
| 664 | 660 | } |
| 665 | - } |
|
| 666 | - else |
|
| 661 | + } else |
|
| 667 | 662 | { |
| 668 | 663 | foreach($_COOKIE as $key=>$value) |
| 669 | 664 | $this->_cookies->add(new THttpCookie($key,$value)); |
@@ -880,8 +875,7 @@ discard block |
||
| 880 | 875 | $value=$this->_items[$key]; |
| 881 | 876 | unset($this->_items[$key]); |
| 882 | 877 | return $value; |
| 883 | - } |
|
| 884 | - else |
|
| 878 | + } else |
|
| 885 | 879 | return null; |
| 886 | 880 | } |
| 887 | 881 | |
@@ -1001,8 +995,7 @@ discard block |
||
| 1001 | 995 | parent::insertAt($index,$item); |
| 1002 | 996 | if($this->_o instanceof THttpResponse) |
| 1003 | 997 | $this->_o->addCookie($item); |
| 1004 | - } |
|
| 1005 | - else |
|
| 998 | + } else |
|
| 1006 | 999 | throw new TInvalidDataTypeException('httpcookiecollection_httpcookie_required'); |
| 1007 | 1000 | } |
| 1008 | 1001 | |
@@ -1303,8 +1296,7 @@ discard block |
||
| 1303 | 1296 | $this->_query=isset($ret['query'])?$ret['query']:''; |
| 1304 | 1297 | $this->_fragment=isset($ret['fragment'])?$ret['fragment']:''; |
| 1305 | 1298 | $this->_uri=$uri; |
| 1306 | - } |
|
| 1307 | - else |
|
| 1299 | + } else |
|
| 1308 | 1300 | { |
| 1309 | 1301 | throw new TInvalidDataValueException('uri_format_invalid',$uri); |
| 1310 | 1302 | } |
@@ -237,8 +237,7 @@ discard block |
||
| 237 | 237 | try |
| 238 | 238 | { |
| 239 | 239 | return $this->handler->callMethod($this->getPayload()); |
| 240 | - } |
|
| 241 | - catch(TRpcException $e) |
|
| 240 | + } catch(TRpcException $e) |
|
| 242 | 241 | { |
| 243 | 242 | return $this->handler->createErrorResponse($e); |
| 244 | 243 | } |
@@ -498,16 +497,13 @@ discard block |
||
| 498 | 497 | )); |
| 499 | 498 | } |
| 500 | 499 | } |
| 501 | - } |
|
| 502 | - catch(TRpcException $e) |
|
| 500 | + } catch(TRpcException $e) |
|
| 503 | 501 | { |
| 504 | 502 | return $this->createErrorResponse($e); |
| 505 | - } |
|
| 506 | - catch(THttpException $e) |
|
| 503 | + } catch(THttpException $e) |
|
| 507 | 504 | { |
| 508 | 505 | throw $e; |
| 509 | - } |
|
| 510 | - catch(Exception $e) |
|
| 506 | + } catch(Exception $e) |
|
| 511 | 507 | { |
| 512 | 508 | return $this->createErrorResponse(new TRpcException('An internal error occured', '-32603')); |
| 513 | 509 | } |
@@ -662,16 +658,13 @@ discard block |
||
| 662 | 658 | try |
| 663 | 659 | { |
| 664 | 660 | return xmlrpc_server_call_method($this->_xmlrpcServer, $requestPayload, null); |
| 665 | - } |
|
| 666 | - catch(TRpcException $e) |
|
| 661 | + } catch(TRpcException $e) |
|
| 667 | 662 | { |
| 668 | 663 | return $this->createErrorResponse($e); |
| 669 | - } |
|
| 670 | - catch(THttpException $e) |
|
| 664 | + } catch(THttpException $e) |
|
| 671 | 665 | { |
| 672 | 666 | throw $e; |
| 673 | - } |
|
| 674 | - catch(Exception $e) |
|
| 667 | + } catch(Exception $e) |
|
| 675 | 668 | { |
| 676 | 669 | return $this->createErrorResponse(new TRpcException('An internal error occured')); |
| 677 | 670 | } |
@@ -232,8 +232,7 @@ discard block |
||
| 232 | 232 | $pageConfig->loadPageConfigurationFromXml($config,$application->getBasePath(),''); |
| 233 | 233 | } |
| 234 | 234 | $pageConfig->loadFromFiles($this->getBasePath()); |
| 235 | - } |
|
| 236 | - else |
|
| 235 | + } else |
|
| 237 | 236 | { |
| 238 | 237 | $configCached=true; |
| 239 | 238 | $currentTimestamp=array(); |
@@ -251,8 +250,7 @@ discard block |
||
| 251 | 250 | $currentTimestamp[0]=$appConfigFile===null?0:@filemtime($appConfigFile); |
| 252 | 251 | if($currentTimestamp[0]>$timestamp || ($timestamp>0 && !$currentTimestamp[0])) |
| 253 | 252 | $configCached=false; |
| 254 | - } |
|
| 255 | - else |
|
| 253 | + } else |
|
| 256 | 254 | { |
| 257 | 255 | $currentTimestamp[$fileName]=@filemtime($fileName); |
| 258 | 256 | if($currentTimestamp[$fileName]>$timestamp || ($timestamp>0 && !$currentTimestamp[$fileName])) |
@@ -260,8 +258,7 @@ discard block |
||
| 260 | 258 | } |
| 261 | 259 | } |
| 262 | 260 | } |
| 263 | - } |
|
| 264 | - else |
|
| 261 | + } else |
|
| 265 | 262 | { |
| 266 | 263 | $configCached=false; |
| 267 | 264 | $paths=explode('.',$pagePath); |
@@ -489,8 +486,7 @@ discard block |
||
| 489 | 486 | $className=basename($path); |
| 490 | 487 | if(!class_exists($className,false)) |
| 491 | 488 | include_once($path.Prado::CLASS_FILE_EXT); |
| 492 | - } |
|
| 493 | - else |
|
| 489 | + } else |
|
| 494 | 490 | { |
| 495 | 491 | $className=$this->getBasePageClass(); |
| 496 | 492 | Prado::using($className); |
@@ -659,8 +655,7 @@ discard block |
||
| 659 | 655 | { |
| 660 | 656 | $fcontent = include $fname; |
| 661 | 657 | $this->loadFromPhp($fcontent,dirname($fname),$configPagePath); |
| 662 | - } |
|
| 663 | - else |
|
| 658 | + } else |
|
| 664 | 659 | { |
| 665 | 660 | $dom=new TXmlDocument; |
| 666 | 661 | if($dom->loadFromFile($fname)) |
@@ -79,8 +79,7 @@ discard block |
||
| 79 | 79 | foreach($config['json'] as $id => $json) |
| 80 | 80 | $this->_services[$id] = $json; |
| 81 | 81 | } |
| 82 | - } |
|
| 83 | - else |
|
| 82 | + } else |
|
| 84 | 83 | { |
| 85 | 84 | foreach($config->getElementsByTagName('json') as $json) |
| 86 | 85 | { |
@@ -111,14 +110,11 @@ discard block |
||
| 111 | 110 | { |
| 112 | 111 | $properties = isset($serviceConfig['properties'])?$serviceConfig['properties']:array(); |
| 113 | 112 | $this->createJsonResponse($service,$properties,$serviceConfig); |
| 114 | - } |
|
| 115 | - else |
|
| 113 | + } else |
|
| 116 | 114 | throw new TConfigurationException('jsonservice_response_type_invalid',$id); |
| 117 | - } |
|
| 118 | - else |
|
| 115 | + } else |
|
| 119 | 116 | throw new TConfigurationException('jsonservice_class_required',$id); |
| 120 | - } |
|
| 121 | - else |
|
| 117 | + } else |
|
| 122 | 118 | { |
| 123 | 119 | $properties=$serviceConfig->getAttributes(); |
| 124 | 120 | if(($class=$properties->remove('class'))!==null) |
@@ -128,12 +124,10 @@ discard block |
||
| 128 | 124 | $this->createJsonResponse($service,$properties,$serviceConfig); |
| 129 | 125 | else |
| 130 | 126 | throw new TConfigurationException('jsonservice_response_type_invalid',$id); |
| 131 | - } |
|
| 132 | - else |
|
| 127 | + } else |
|
| 133 | 128 | throw new TConfigurationException('jsonservice_class_required',$id); |
| 134 | 129 | } |
| 135 | - } |
|
| 136 | - else |
|
| 130 | + } else |
|
| 137 | 131 | throw new THttpException(404,'jsonservice_provider_unknown',$id); |
| 138 | 132 | } |
| 139 | 133 | |
@@ -118,8 +118,7 @@ discard block |
||
| 118 | 118 | $dom=new TXmlDocument; |
| 119 | 119 | $dom->loadFromFile($this->_configFile); |
| 120 | 120 | $this->loadConfig($dom); |
| 121 | - } |
|
| 122 | - else |
|
| 121 | + } else |
|
| 123 | 122 | throw new TConfigurationException('soapservice_configfile_invalid',$this->_configFile); |
| 124 | 123 | } |
| 125 | 124 | $this->loadConfig($config); |
@@ -141,8 +140,7 @@ discard block |
||
| 141 | 140 | { |
| 142 | 141 | $serverID=substr($serverID,0,$pos); |
| 143 | 142 | $this->_wsdlRequest=true; |
| 144 | - } |
|
| 145 | - else |
|
| 143 | + } else |
|
| 146 | 144 | $this->_wsdlRequest=false; |
| 147 | 145 | $this->_serverID=$serverID; |
| 148 | 146 | if(!isset($this->_servers[$serverID])) |
@@ -168,8 +166,7 @@ discard block |
||
| 168 | 166 | $this->_servers[$id]=$properties; |
| 169 | 167 | } |
| 170 | 168 | } |
| 171 | - } |
|
| 172 | - else |
|
| 169 | + } else |
|
| 173 | 170 | { |
| 174 | 171 | foreach($config->getElementsByTagName('soap') as $serverXML) |
| 175 | 172 | { |
@@ -276,8 +273,7 @@ discard block |
||
| 276 | 273 | Prado::trace("Generating WSDL",'System.Web.Services.TSoapService'); |
| 277 | 274 | $this->getResponse()->clear(); |
| 278 | 275 | $this->getResponse()->write($server->getWsdl()); |
| 279 | - } |
|
| 280 | - else |
|
| 276 | + } else |
|
| 281 | 277 | { |
| 282 | 278 | // provide SOAP service |
| 283 | 279 | Prado::trace("Handling SOAP request",'System.Web.Services.TSoapService'); |
@@ -350,14 +346,12 @@ discard block |
||
| 350 | 346 | $server->setClass($providerClass, $this); |
| 351 | 347 | if($this->_persistent) |
| 352 | 348 | $server->setPersistence(SOAP_PERSISTENCE_SESSION); |
| 353 | - } |
|
| 354 | - else |
|
| 349 | + } else |
|
| 355 | 350 | $server=$this->createServer(); |
| 356 | 351 | try |
| 357 | 352 | { |
| 358 | 353 | $server->handle(); |
| 359 | - } |
|
| 360 | - catch (Exception $e) |
|
| 354 | + } catch (Exception $e) |
|
| 361 | 355 | { |
| 362 | 356 | if($this->getApplication()->getMode()===TApplicationMode::Debug) |
| 363 | 357 | $this->fault($e->getMessage(), $e->__toString()); |
@@ -470,14 +464,12 @@ discard block |
||
| 470 | 464 | $wsdl=WsdlGenerator::generate($providerClass, $this->getUri(), $this->getEncoding()); |
| 471 | 465 | $cache->set(self::WSDL_CACHE_PREFIX.$providerClass,$wsdl); |
| 472 | 466 | return $wsdl; |
| 473 | - } |
|
| 474 | - else |
|
| 467 | + } else |
|
| 475 | 468 | { |
| 476 | 469 | Prado::using('System.3rdParty.WsdlGen.WsdlGenerator'); |
| 477 | 470 | return WsdlGenerator::generate($providerClass, $this->getUri(), $this->getEncoding()); |
| 478 | 471 | } |
| 479 | - } |
|
| 480 | - else |
|
| 472 | + } else |
|
| 481 | 473 | return file_get_contents($this->_wsdlUri); |
| 482 | 474 | } |
| 483 | 475 | |
@@ -74,8 +74,7 @@ discard block |
||
| 74 | 74 | foreach($config as $id => $feed) |
| 75 | 75 | $this->_feeds[$id] = $feed; |
| 76 | 76 | } |
| 77 | - } |
|
| 78 | - else |
|
| 77 | + } else |
|
| 79 | 78 | { |
| 80 | 79 | foreach($config->getElementsByTagName('feed') as $feed) |
| 81 | 80 | { |
@@ -116,11 +115,9 @@ discard block |
||
| 116 | 115 | $properties=isset($feedConfig['properties'])?$feedConfig['properties']:array(); |
| 117 | 116 | else |
| 118 | 117 | throw new TConfigurationException('jsonservice_response_type_invalid',$id); |
| 119 | - } |
|
| 120 | - else |
|
| 118 | + } else |
|
| 121 | 119 | throw new TConfigurationException('jsonservice_class_required',$id); |
| 122 | - } |
|
| 123 | - else |
|
| 120 | + } else |
|
| 124 | 121 | { |
| 125 | 122 | $properties=$feedConfig->getAttributes(); |
| 126 | 123 | if(($class=$properties->remove('class'))!==null) |
@@ -128,8 +125,7 @@ discard block |
||
| 128 | 125 | $feed=Prado::createComponent($class); |
| 129 | 126 | if(!($feed instanceof IFeedContentProvider)) |
| 130 | 127 | throw new TConfigurationException('feedservice_feedtype_invalid',$id); |
| 131 | - } |
|
| 132 | - else |
|
| 128 | + } else |
|
| 133 | 129 | throw new TConfigurationException('feedservice_class_required',$id); |
| 134 | 130 | } |
| 135 | 131 | |
@@ -142,8 +138,7 @@ discard block |
||
| 142 | 138 | //$this->getResponse()->setContentType('application/rss+xml'); |
| 143 | 139 | $this->getResponse()->setContentType($feed->getContentType()); |
| 144 | 140 | $this->getResponse()->write($content); |
| 145 | - } |
|
| 146 | - else |
|
| 141 | + } else |
|
| 147 | 142 | throw new THttpException(404,'feedservice_feed_unknown',$id); |
| 148 | 143 | } |
| 149 | 144 | } |
@@ -72,8 +72,7 @@ discard block |
||
| 72 | 72 | $this->_activeControlType = 'TBaseActiveCallbackControl'; |
| 73 | 73 | else |
| 74 | 74 | $this->_activeControlType = 'TBaseActiveControl'; |
| 75 | - } |
|
| 76 | - else |
|
| 75 | + } else |
|
| 77 | 76 | $this->_activeControlType = $type; |
| 78 | 77 | } |
| 79 | 78 | |
@@ -491,8 +490,7 @@ discard block |
||
| 491 | 490 | { |
| 492 | 491 | return ($this->_new!==null) && $this->_new->hasCssClass() |
| 493 | 492 | ? $this->_new->getCssClass() : null; |
| 494 | - } |
|
| 495 | - else |
|
| 493 | + } else |
|
| 496 | 494 | { |
| 497 | 495 | return $this->_old->getCssClass() !== $this->_new->getCssClass() ? |
| 498 | 496 | $this->_new->getCssClass() : null; |
@@ -548,8 +546,7 @@ discard block |
||
| 548 | 546 | if($this->_old===null) |
| 549 | 547 | { |
| 550 | 548 | return ($this->_new!==null) ? $this->_new->toArray() : $this->_null; |
| 551 | - } |
|
| 552 | - else |
|
| 549 | + } else |
|
| 553 | 550 | { |
| 554 | 551 | $new = $this->_new->toArray(); |
| 555 | 552 | $old = $this->_old->toArray(); |
@@ -251,14 +251,12 @@ discard block |
||
| 251 | 251 | $param = $this->getCallbackEventParameter(); |
| 252 | 252 | $result = new TCallbackEventParameter($this->getResponse(), $param); |
| 253 | 253 | $callbackHandler->raiseCallbackEvent($result); |
| 254 | - } |
|
| 255 | - else |
|
| 254 | + } else |
|
| 256 | 255 | { |
| 257 | 256 | throw new TInvalidCallbackException( |
| 258 | 257 | 'callback_invalid_handler', $callbackHandler->getUniqueID()); |
| 259 | 258 | } |
| 260 | - } |
|
| 261 | - else |
|
| 259 | + } else |
|
| 262 | 260 | { |
| 263 | 261 | $target = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_TARGET); |
| 264 | 262 | throw new TInvalidCallbackException('callback_invalid_target', $target); |
@@ -365,8 +363,7 @@ discard block |
||
| 365 | 363 | $content = $response->createHtmlWriter(); |
| 366 | 364 | $content->getWriter()->setBoundary(TActivePageAdapter::CALLBACK_ERROR_HEADER); |
| 367 | 365 | $content->write($trace); |
| 368 | - } |
|
| 369 | - else |
|
| 366 | + } else |
|
| 370 | 367 | { |
| 371 | 368 | error_log("Error happened while processing an existing error:\n".$exception->__toString()); |
| 372 | 369 | header('HTTP/1.0 500 Internal Server Error', true, 500); |
@@ -95,8 +95,7 @@ |
||
| 95 | 95 | if($this->getHasPreRendered()) { |
| 96 | 96 | $this->renderRepeater($writer); |
| 97 | 97 | if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(),$writer); |
| 98 | - } |
|
| 99 | - else { |
|
| 98 | + } else { |
|
| 100 | 99 | $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
| 101 | 100 | } |
| 102 | 101 | } |