summaryrefslogtreecommitdiff
path: root/app/php/db/DBModule.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-04-20 17:17:59 +0200
committeremkael <emkael@tlen.pl>2016-04-20 17:17:59 +0200
commitd923fd65d3d70f80852bb53b77f2724fecccb7d9 (patch)
tree4bc026cf8ec14b1ec1bab5ab916edb374f19f7dd /app/php/db/DBModule.php
parent4e9251ea265a24e749b7756da2585663e8f85232 (diff)
* switching to namespace-based DB config path
Diffstat (limited to 'app/php/db/DBModule.php')
-rw-r--r--app/php/db/DBModule.php12
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);
}
-
+
}
?>