summaryrefslogtreecommitdiff
path: root/framework/Data/TDataSourceConfig.php
diff options
context:
space:
mode:
authorChristophe.Boulain <>2009-05-27 13:55:58 +0000
committerChristophe.Boulain <>2009-05-27 13:55:58 +0000
commit7d15c048340cbcbd06cb9664b479d45906d2b0d8 (patch)
tree0af02875479def0e52d5ea1b6d11b5a276a477a6 /framework/Data/TDataSourceConfig.php
parent5a87ceb5ce3a62aae92c344f670059971d5914d9 (diff)
parent9a87732ce51fd34e312ac63ed1ebec8d7fc1c16f (diff)
Merge from 3.2 branch.
Beginning of Prado 3.2 development
Diffstat (limited to 'framework/Data/TDataSourceConfig.php')
-rw-r--r--framework/Data/TDataSourceConfig.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/framework/Data/TDataSourceConfig.php b/framework/Data/TDataSourceConfig.php
index 53a5ef22..cf1f963c 100644
--- a/framework/Data/TDataSourceConfig.php
+++ b/framework/Data/TDataSourceConfig.php
@@ -58,11 +58,23 @@ class TDataSourceConfig extends TModule
*/
public function init($xml)
{
- if($prop=$xml->getElementByTagName('database'))
+ if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
{
- $db=$this->getDbConnection();
- foreach($prop->getAttributes() as $name=>$value)
- $db->setSubproperty($name,$value);
+ if(isset($xml['database']) && is_array($xml['database']))
+ {
+ $db=$this->getDbConnection();
+ foreach($xml['database'] as $name=>$value)
+ $db->setSubProperty($name,$value);
+ }
+ }
+ else
+ {
+ if($prop=$xml->getElementByTagName('database'))
+ {
+ $db=$this->getDbConnection();
+ foreach($prop->getAttributes() as $name=>$value)
+ $db->setSubproperty($name,$value);
+ }
}
}
@@ -153,4 +165,3 @@ class TDataSourceConfig extends TModule
throw new TConfigurationException('datasource_dbconnection_invalid',$id);
}
}
-