diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/php/db/DBConnection.php | 5 | ||||
-rw-r--r-- | app/php/db/DBModule.php | 7 | ||||
-rw-r--r-- | app/php/db/config.xml | 4 |
3 files changed, 6 insertions, 10 deletions
diff --git a/app/php/db/DBConnection.php b/app/php/db/DBConnection.php index 4fb18c8..92ab0fb 100644 --- a/app/php/db/DBConnection.php +++ b/app/php/db/DBConnection.php @@ -5,11 +5,6 @@ Prado::using('System.Data.TDbConnection'); class DBConnection extends TDbConnection { - public function __construct($dsn = '', $username = '', $password = '', $charset = '') { - $this->setTransactionClass('Application.Code.DBTransaction'); - parent::__construct($dsn, $username, $password, $charset); - } - private $_transaction = NULL; public function getCurrentTransaction() { if (!$this->_transaction->getActive()) { diff --git a/app/php/db/DBModule.php b/app/php/db/DBModule.php index 592dc12..462b6f6 100644 --- a/app/php/db/DBModule.php +++ b/app/php/db/DBModule.php @@ -7,15 +7,14 @@ class DBModule extends TDataSourceConfig { private $_config; public function init($xml) { - $this->setConnectionClass('Application.db.DBConnection'); - $config = json_decode(file_get_contents( - Prado::getPathOfNamespace($this->_config, '.json') - )); $newXML = new TXmlElement('module'); foreach ($xml->getAttributes() as $attr => $val) { $newXML->setAttribute($attr, $val); } $dbXML = new TXmlElement('database'); + $config = json_decode(file_get_contents( + Prado::getPathOfNamespace($this->_config, '.json') + )); if (isset($config->cset)) { $dbXML->setAttribute('Charset', $config->cset); } diff --git a/app/php/db/config.xml b/app/php/db/config.xml index cf484d0..3210593 100644 --- a/app/php/db/config.xml +++ b/app/php/db/config.xml @@ -3,6 +3,8 @@ <modules> <module id="db" class="Application.db.DBModule" - config="Application.db.config" /> + config="Application.db.config" + ConnectionClass="Application.db.DBConnection" + DbConnection.TransactionClass="Application.db.DBTransaction" /> </modules> </configuration> |