diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-03 02:19:28 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-03 02:19:28 +0100 |
commit | 08856b8738ea4fc17b13986c9f2619383cb4a6e9 (patch) | |
tree | f214c1498b4ec7cc1958b3654353748954a2a141 /system/database/drivers/interbase/interbase_driver.php | |
parent | 75b2c7fd0e23afc5c0338a7b62854d38b37b9c62 (diff) |
Improve DB version() implementation and add pg_version() support
Diffstat (limited to 'system/database/drivers/interbase/interbase_driver.php')
-rw-r--r-- | system/database/drivers/interbase/interbase_driver.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/system/database/drivers/interbase/interbase_driver.php b/system/database/drivers/interbase/interbase_driver.php index 51e814e16..f4bd9e271 100644 --- a/system/database/drivers/interbase/interbase_driver.php +++ b/system/database/drivers/interbase/interbase_driver.php @@ -115,19 +115,24 @@ class CI_DB_interbase_driver extends CI_DB { // -------------------------------------------------------------------- /** - * Version number query string + * Database version number * * @return string */ - protected function _version() + public function version() { + if (isset($this->data_cache['version'])) + { + return $this->data_cache['version']; + } + if (($service = ibase_service_attach($this->hostname, $this->username, $this->password))) { - $version = ibase_server_info($service, IBASE_SVC_SERVER_VERSION); + $this->data_cache['version'] = ibase_server_info($service, IBASE_SVC_SERVER_VERSION); // Don't keep the service open ibase_service_detach($service); - return $version; + return $this->data_cache['version']; } return FALSE; @@ -581,7 +586,7 @@ SQL; $orig_sql = $sql; // Limit clause depends on if Interbase or Firebird - if (stripos($this->_version(), 'firebird') !== FALSE) + if (stripos($this->version(), 'firebird') !== FALSE) { $sql = 'FIRST '. (int) $limit; |