From 1e6892971b471957c1beb55b2e6cd472054741ca Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 19 Nov 2024 07:03:06 +0100 Subject: [PATCH] Change spaces to tabs --- system/libs/pot/OTS_DB_MySQL.php | 114 +++++++++++++++---------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/system/libs/pot/OTS_DB_MySQL.php b/system/libs/pot/OTS_DB_MySQL.php index 318f2e9f..89e8dd0d 100644 --- a/system/libs/pot/OTS_DB_MySQL.php +++ b/system/libs/pot/OTS_DB_MySQL.php @@ -53,49 +53,49 @@ class OTS_DB_MySQL extends OTS_Base_DB * @param array $params Connection parameters. * @throws PDOException On PDO operation error. */ - public function __construct($params) - { - $user = null; - $password = null; - $dns = array(); + public function __construct($params) + { + $user = null; + $password = null; + $dns = array(); - // host:port support - if( strpos(':', $params['host']) !== false) - { - $host = explode(':', $params['host'], 2); + // host:port support + if( strpos(':', $params['host']) !== false) + { + $host = explode(':', $params['host'], 2); - $params['host'] = $host[0]; - $params['port'] = $host[1]; - } + $params['host'] = $host[0]; + $params['port'] = $host[1]; + } - if( isset($params['database']) ) - { - $dns[] = 'dbname=' . $params['database']; - } + if( isset($params['database']) ) + { + $dns[] = 'dbname=' . $params['database']; + } - if( isset($params['user']) ) - { - $user = $params['user']; - } + if( isset($params['user']) ) + { + $user = $params['user']; + } - if( isset($params['password']) ) - { - $password = $params['password']; - } + if( isset($params['password']) ) + { + $password = $params['password']; + } - if( isset($params['prefix']) ) - { - $this->prefix = $params['prefix']; - } + if( isset($params['prefix']) ) + { + $this->prefix = $params['prefix']; + } - if( isset($params['log']) && $params['log'] ) - { - $this->logged = true; - } + if( isset($params['log']) && $params['log'] ) + { + $this->logged = true; + } - if( !isset($params['persistent']) ) { - $params['persistent'] = false; - } + if( !isset($params['persistent']) ) { + $params['persistent'] = false; + } global $config; $cache = Cache::getInstance(); @@ -144,10 +144,10 @@ class OTS_DB_MySQL extends OTS_Base_DB } parent::__construct('mysql:' . implode(';', $dns), $user, $password, $driverAttributes); - } + } public function __destruct() - { + { global $config; $cache = Cache::getInstance(); @@ -176,10 +176,10 @@ class OTS_DB_MySQL extends OTS_Base_DB * @param string $name Field name. * @return string Quoted name. */ - public function fieldName($name) - { - return '`' . $name . '`'; - } + public function fieldName($name) + { + return '`' . $name . '`'; + } /** * LIMIT/OFFSET clause for queries. @@ -188,26 +188,26 @@ class OTS_DB_MySQL extends OTS_Base_DB * @param int|bool $offset Number of rows to be skipped before applying query effects (false if no offset). * @return string LIMIT/OFFSET SQL clause for query. */ - public function limit($limit = false, $offset = false) - { - // by default this is empty part - $sql = ''; + public function limit($limit = false, $offset = false) + { + // by default this is empty part + $sql = ''; - if($limit !== false) - { - $sql = ' LIMIT '; + if($limit !== false) + { + $sql = ' LIMIT '; - // OFFSET has no effect if there is no LIMIT - if($offset !== false) - { - $sql .= $offset . ', '; - } + // OFFSET has no effect if there is no LIMIT + if($offset !== false) + { + $sql .= $offset . ', '; + } - $sql .= $limit; - } + $sql .= $limit; + } - return $sql; - } + return $sql; + } public function hasTable($name) { if(isset($this->has_table_cache[$name])) {