diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2008-09-04 12:01:47 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2008-09-04 12:01:47 +0000 |
commit | 2fcd96ca72741bdfb36c24a0af9dd8230b5a828f (patch) | |
tree | af6068957c73f64d5885311396c1d7730aa30b3c /phpBB/includes/db/firebird.php | |
parent | 4a225280a0fe1b7c364a007eb43dc93975c544e9 (diff) | |
download | forums-2fcd96ca72741bdfb36c24a0af9dd8230b5a828f.tar forums-2fcd96ca72741bdfb36c24a0af9dd8230b5a828f.tar.gz forums-2fcd96ca72741bdfb36c24a0af9dd8230b5a828f.tar.bz2 forums-2fcd96ca72741bdfb36c24a0af9dd8230b5a828f.tar.xz forums-2fcd96ca72741bdfb36c24a0af9dd8230b5a828f.zip |
Ok, story real database server info, as well as caching it
Store it on installation too - allows us to check the db version used on installation and used currently to warn the user about incompatibilities
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8814 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db/firebird.php')
-rw-r--r-- | phpBB/includes/db/firebird.php | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 6765f2af48..0157238fcd 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -37,26 +37,42 @@ class dbal_firebird extends dbal $this->persistency = $persistency; $this->user = $sqluser; $this->server = $sqlserver . (($port) ? ':' . $port : ''); - $this->dbname = $database; + $this->dbname = str_replace('\\', '/', $database); - $this->db_connect_id = ($this->persistency) ? @ibase_pconnect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3); + // There are three possibilities to connect to an interbase db + if (!$this->server) + { + $use_database = $this->dbname; + } + else if (strpos($this->server, '//') === 0) + { + $use_database = $this->server . $this->dbname; + } + else + { + $use_database = $this->server . ':' . $this->dbname; + } + + $this->db_connect_id = ($this->persistency) ? @ibase_pconnect($use_database, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($use_database, $this->user, $sqlpassword, false, false, 3); - $this->service_handle = (function_exists('ibase_service_attach')) ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false; + $this->service_handle = (function_exists('ibase_service_attach') && $this->server) ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false; return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); } /** * Version information about used database + * @param bool $raw if true, only return the fetched sql_server_version + * @return string sql server version */ - function sql_server_info() + function sql_server_info($raw = false) { if ($this->service_handle !== false && function_exists('ibase_server_info')) { return @ibase_server_info($this->service_handle, IBASE_SVC_SERVER_VERSION); } - return 'Firebird/Interbase'; + return ($raw) ? '2.0' : 'Firebird/Interbase'; } /** |