From 105b449cf7de18b6610d46bf9234f55c8d7204c1 Mon Sep 17 00:00:00 2001 From: carlgmathisen <> Date: Wed, 29 Oct 2008 11:51:08 +0000 Subject: Issue 32 - Implement ability to specify default service ID --- framework/TApplication.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'framework/TApplication.php') diff --git a/framework/TApplication.php b/framework/TApplication.php index e1bce92c..1c2b9bd4 100644 --- a/framework/TApplication.php +++ b/framework/TApplication.php @@ -268,6 +268,8 @@ class TApplication extends TComponent * @var TApplicationMode application mode */ private $_mode=TApplicationMode::Debug; + + private $_pageServiceID = self::PAGE_SERVICE_ID; /** * Constructor. @@ -300,7 +302,7 @@ class TApplication extends TComponent // generates unique ID by hashing the runtime path $this->_uniqueID=md5($this->_runtimePath); $this->_parameters=new TMap; - $this->_services=array(self::PAGE_SERVICE_ID=>array('TPageService',array(),null)); + Prado::setPathOfAlias('Application',$this->_basePath); } @@ -484,6 +486,22 @@ class TApplication extends TComponent { $this->_id=$value; } + + /** + * @return string page service ID + */ + public function getPageServiceID() + { + return $this->_pageServiceID; + } + + /** + * @param string page service ID + */ + public function setPageServiceID($value) + { + $this->_pageServiceID=$value; + } /** * @return string an ID that uniquely identifies this Prado application from the others @@ -842,8 +860,12 @@ class TApplication extends TComponent if(!$withinService) { foreach($config->getProperties() as $name=>$value) + { $this->setSubProperty($name,$value); + } } + + $this->_services=array($this->getPageServiceID()=>array('TPageService',array(),null)); // load parameters foreach($config->getParameters() as $id=>$parameter) @@ -928,7 +950,7 @@ class TApplication extends TComponent } if(($serviceID=$this->getRequest()->resolveRequest(array_keys($this->_services)))===null) - $serviceID=self::PAGE_SERVICE_ID; + $serviceID=$this->getPageServiceID(); $this->startService($serviceID); } -- cgit v1.2.3