diff options
Diffstat (limited to 'app/php/db/DBModule.php')
-rw-r--r-- | app/php/db/DBModule.php | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/app/php/db/DBModule.php b/app/php/db/DBModule.php index 3622db0..592dc12 100644 --- a/app/php/db/DBModule.php +++ b/app/php/db/DBModule.php @@ -5,15 +5,11 @@ Prado::using('System.Data.TDataSourceConfig'); class DBModule extends TDataSourceConfig { private $_config; - + public function init($xml) { $this->setConnectionClass('Application.db.DBConnection'); $config = json_decode(file_get_contents( - realpath( - $this->getApplication()->getBasePath() - . DIRECTORY_SEPARATOR - . $this->_config - ) + Prado::getPathOfNamespace($this->_config, '.json') )); $newXML = new TXmlElement('module'); foreach ($xml->getAttributes() as $attr => $val) { @@ -35,11 +31,11 @@ class DBModule extends TDataSourceConfig { $newXML->Elements[] = $dbXML; parent::init($newXML); } - + public function setConfig($config) { $this->_config = TPropertyValue::ensureString($config); } - + } ?> |