diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2008-09-04 14:10:03 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2008-09-04 14:10:03 +0000 |
| commit | 3a330753f413c3e024163f8f401f327bc2f9930c (patch) | |
| tree | 37621305e29c6b56e8aa93778e8ec3bc64f38a38 /phpBB/includes/db/firebird.php | |
| parent | a736c97c04bde8138c3cb7236004e30133d91b65 (diff) | |
| download | forums-3a330753f413c3e024163f8f401f327bc2f9930c.tar forums-3a330753f413c3e024163f8f401f327bc2f9930c.tar.gz forums-3a330753f413c3e024163f8f401f327bc2f9930c.tar.bz2 forums-3a330753f413c3e024163f8f401f327bc2f9930c.tar.xz forums-3a330753f413c3e024163f8f401f327bc2f9930c.zip | |
Get real dbms version instead of relying on php internal functions which only grab the local library version
git-svn-id: file:///svn/phpbb/trunk@8821 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 429c0f2d4f..2f577244eb 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -41,26 +41,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 = (strtolower($this->user) == 'sysdba') ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false; + $this->service_handle = (strtolower($this->user) == 'sysdba' && $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) { return @ibase_server_info($this->service_handle, IBASE_SVC_SERVER_VERSION); } - return 'Firebird/Interbase'; + return ($raw) ? '2.0' : 'Firebird/Interbase'; } /** |
