diff options
author | Andrei Rosseti <andrei@facedigital.com.br> | 2017-08-31 14:40:06 +0200 |
---|---|---|
committer | Andrei Rosseti <andrei@facedigital.com.br> | 2017-08-31 14:40:06 +0200 |
commit | ec948d3665d50a5d4786fac4d806941d3e989f7e (patch) | |
tree | 9ce828b11731a412a2ec88c9eda0f12125b55b70 /system/database/drivers | |
parent | e1f7e5430b3b7761467b918b07890e94edc6e663 (diff) |
Refactoring some codeblocks.
Diffstat (limited to 'system/database/drivers')
-rw-r--r-- | system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php index 048759fef..fbd279681 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php @@ -334,31 +334,20 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver { return ($this->db_debug) ? $this->display_error('db_unsupported_feature') : FALSE; } + // -------------------------------------------------------------------- + /** - * Database version number - * Fix by Andrei Rosseti <andrei@facedigital.com.br> - * @return string - */ - public function version() - { - if (isset($this->data_cache['version'])) - { - return $this->data_cache['version']; - } - - try - { - $productversion = $this->conn_id->query("SELECT - CAST( - SERVERPROPERTY('productversion') - AS VARCHAR - )")->fetchColumn(0); - - return $this->data_cache['version'] = $productversion; - } - catch (PDOException $e) - { - return parent::version(); - } - } + * Database version number + * + * @return string + */ + public function version() + { + if (isset($this->data_cache['version'])) + { + return $this->data_cache['version']; + } + + return $this->data_cache['version'] = $this->conn_id->query("SELECT SERVERPROPERTY('ProductVersion') AS ver")->fetchColumn(0); + } } |