summaryrefslogtreecommitdiff
path: root/framework/Data
diff options
context:
space:
mode:
authorcarlgmathisen <>2008-12-02 00:02:51 +0000
committercarlgmathisen <>2008-12-02 00:02:51 +0000
commit439b0b12dc8f6cbeb769fe4f2c0061ff9d3c9d31 (patch)
tree30046fc52a8c2ae53bad05224c95dbabd0d5238f /framework/Data
parentc356dfc6660d68f1e7fbde92aaf15c6a94894d4f (diff)
php configuration type
Diffstat (limited to 'framework/Data')
-rw-r--r--framework/Data/TDataSourceConfig.php28
1 files changed, 20 insertions, 8 deletions
diff --git a/framework/Data/TDataSourceConfig.php b/framework/Data/TDataSourceConfig.php
index a02c68a1..804ea848 100644
--- a/framework/Data/TDataSourceConfig.php
+++ b/framework/Data/TDataSourceConfig.php
@@ -1,10 +1,10 @@
-<?php
+<?php
/**
* TDataSourceConfig class file.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data
@@ -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,5 +165,5 @@ class TDataSourceConfig extends TModule
throw new TConfigurationException('datasource_dbconnection_invalid',$id);
}
}
-
-?>
+
+?>