From 823d71ced9b4947b1a5a5ade7245d521ed490061 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 7 Jun 2016 15:17:49 +0200 Subject: * renaming php directory --- app/php/db/ActiveRecord.php | 69 -------------------------------------------- app/php/db/DBConnection.php | 28 ------------------ app/php/db/DBModule.php | 40 ------------------------- app/php/db/DBTransaction.php | 53 ---------------------------------- app/php/db/config.json | 1 - app/php/db/config.xml | 10 ------- 6 files changed, 201 deletions(-) delete mode 100644 app/php/db/ActiveRecord.php delete mode 100644 app/php/db/DBConnection.php delete mode 100644 app/php/db/DBModule.php delete mode 100644 app/php/db/DBTransaction.php delete mode 120000 app/php/db/config.json delete mode 100644 app/php/db/config.xml (limited to 'app/php/db') diff --git a/app/php/db/ActiveRecord.php b/app/php/db/ActiveRecord.php deleted file mode 100644 index 1176767..0000000 --- a/app/php/db/ActiveRecord.php +++ /dev/null @@ -1,69 +0,0 @@ - 2) { - $method .= $parameter[2]; - } - } - } - } - } - return $method; - } - - public function __get($name) { - $name = $this->_getMappedPropertyName($name); - if (property_exists($this, $name)) { - return $this->$name; - } - return parent::__get($name); - } - - public function __set($name, $value) { - $name = $this->_getMappedPropertyName($name); - if (property_exists($this, $name)) { - return $this->$name = $value; - } - return parent::__set($name, $value); - } - - public function __call($method, $args) { - return parent::__call($this->_getMappedMethodName($method), $args); - } - -} - -?> diff --git a/app/php/db/DBConnection.php b/app/php/db/DBConnection.php deleted file mode 100644 index 92ab0fb..0000000 --- a/app/php/db/DBConnection.php +++ /dev/null @@ -1,28 +0,0 @@ -_transaction->getActive()) { - $this->_transaction = NULL; - } - return $this->_transaction; - } - - public function beginTransaction() { - if ($this->_transaction && $this->_transaction->getActive()) { - $this->_transaction->beginNestedTransaction(); - } - else { - $this->_transaction = parent::beginTransaction(); - } - return $this->_transaction; - } - -} - -?> diff --git a/app/php/db/DBModule.php b/app/php/db/DBModule.php deleted file mode 100644 index 462b6f6..0000000 --- a/app/php/db/DBModule.php +++ /dev/null @@ -1,40 +0,0 @@ -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); - } - $dbXML->setAttribute('Username', $config->user); - $dbXML->setAttribute('Password', $config->pass); - $dbXML->setAttribute( - 'ConnectionString', - sprintf( - '%s:host=%s;dbname=%s', - $config->type, $config->host, $config->name - ) - ); - $newXML->Elements[] = $dbXML; - parent::init($newXML); - } - - public function setConfig($config) { - $this->_config = TPropertyValue::ensureString($config); - } - -} - -?> diff --git a/app/php/db/DBTransaction.php b/app/php/db/DBTransaction.php deleted file mode 100644 index b176453..0000000 --- a/app/php/db/DBTransaction.php +++ /dev/null @@ -1,53 +0,0 @@ -getActive()) { - $this->_nestedCount++; - } - } - - public function commit() { - if ($this->_rolledBack) { - $childTransaction = (bool)($this->_nestedCount); - $this->rollback(); - if (!$childTransaction) { - throw new TDbException('Nested transaction was rolled back, unable to commit.'); - } - } - else { - if ($this->_nestedCount) { - $this->_nestedCount--; - } - else { - parent::commit(); - } - } - } - - public function rollback() { - if (!$this->getActive()) { - $this->_nestedCount = 0; - return; - } - if ($this->_nestedCount) { - $this->_rolledBack = TRUE; - $this->_nestedCount--; - } - else { - parent::rollback(); - $this->_nestedCount = 0; - $this->_rolledBack = FALSE; - } - } - -} - -?> diff --git a/app/php/db/config.json b/app/php/db/config.json deleted file mode 120000 index 89a492f..0000000 --- a/app/php/db/config.json +++ /dev/null @@ -1 +0,0 @@ -../../../config/db.json \ No newline at end of file diff --git a/app/php/db/config.xml b/app/php/db/config.xml deleted file mode 100644 index 3210593..0000000 --- a/app/php/db/config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -- cgit v1.2.3