summaryrefslogtreecommitdiff
path: root/framework/TApplication.php
diff options
context:
space:
mode:
authorcarlgmathisen <>2008-10-29 11:51:08 +0000
committercarlgmathisen <>2008-10-29 11:51:08 +0000
commit105b449cf7de18b6610d46bf9234f55c8d7204c1 (patch)
tree89441fe9357f14e6f61b66b34da1979003735e40 /framework/TApplication.php
parent2d252778c083b7f655bca1f270a2c80b6f053bf8 (diff)
Issue 32 - Implement ability to specify default service ID
Diffstat (limited to 'framework/TApplication.php')
-rw-r--r--framework/TApplication.php26
1 files changed, 24 insertions, 2 deletions
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);
}