Skip to content

Commit

Permalink
added GetServerVersion()
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/MDB2/trunk@202721 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
quipo committed Dec 12, 2005
1 parent 6b6f742 commit 15c7813
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions MDB2/Driver/ibase.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ function __construct()
$this->supported['auto_increment'] = true;
$this->supported['primary_key'] = true;

$this->options['DBA_username'] = false;
$this->options['DBA_password'] = false;
$this->options['database_path'] = '';
$this->options['database_extension'] = '.gdb';
$this->options['default_text_field_length'] = 4096;
Expand Down Expand Up @@ -534,6 +536,36 @@ function _modifyQuery($query, $is_manip, $limit, $offset)
return $query;
}

// }}}
// {{{ getServerVersion()

/**
* return version information about the server
*
* @param string $native determines if the raw version string should be returned
* @return mixed array with versoin information or row string
* @access public
*/
function getServerVersion($native = false)
{
$ibserv = ibase_service_attach($this->dsn['hostspec'], $this->options['DBA_username'], $this->options['DBA_password']);
$server_info = ibase_server_info($ibserv, IBASE_SVC_SERVER_VERSION);
ibase_service_detach($ibserv);
if (!$native) {
//WI-V1.5.3.4854 Firebird 1.5
preg_match('/-V([\d\.]*)/', $server_info, $matches);
$tmp = explode('.', $matches[1]);
$server_info = array(
'major' => @$tmp[0],
'minor' => @$tmp[1],
'patch' => @$tmp[2],
'extra' => @$tmp[3],
'native' => $server_info,
);
}
return $server_info;
}

// }}}
// {{{ prepare()

Expand Down
1 change: 1 addition & 0 deletions package_ibase.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- added ability to determine unsigned in mapNativeDatatype()
(only really implemented in the mysql(i) drivers) (bug #6054)
- use MDB2_ERROR_NOT_FOUND in getTableConstraintDefinition() and getTableIndexDefinition() (bug #6055)
- added getServerVersion()
- unified array structure in mapNativeDatatype() *BC BREAK*
- added 'mdbtype' to tableInfo() output that is generated from mapNativeDatatype()
- changed 'len' to 'length' in tableInfo() output *BC BREAK*
Expand Down

0 comments on commit 15c7813

Please sign in to comment.