summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarlgmathisen <>2008-10-29 11:51:08 +0000
committercarlgmathisen <>2008-10-29 11:51:08 +0000
commit105b449cf7de18b6610d46bf9234f55c8d7204c1 (patch)
tree89441fe9357f14e6f61b66b34da1979003735e40
parent2d252778c083b7f655bca1f270a2c80b6f053bf8 (diff)
Issue 32 - Implement ability to specify default service ID
-rw-r--r--HISTORY3
-rw-r--r--framework/TApplication.php26
2 files changed, 26 insertions, 3 deletions
diff --git a/HISTORY b/HISTORY
index 69daecf4..37c3dabc 100644
--- a/HISTORY
+++ b/HISTORY
@@ -51,7 +51,8 @@ NEW: Ticket#935 - Added TActiveDatePicker (Bradley, Christophe)
NEW: Ticket#857 - Added Authentication expiration support to TAuthManager (Michael)
NEW: Ticket#853 - Added Drag and drop components (Christophe)
NEW: Ticket#891 - Added method that returns table name to TActiveRecord (Michael)
-BUG: Ticket#38 - [835] TValidationSummary, works different when it's showing Javascript Validation than Server Validation (Carl)
+BUG: Ticket#38 - (trac:835) TValidationSummary, works different when it's showing Javascript Validation than Server Validation (Carl)
+ENH: Ticket#32 - (trac:861) Implement ability to specify default service ID (Carl)
Version 3.1.2 April 21, 2008
============================
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);
}