|
From: OryNider <ory...@us...> - 2008-01-16 04:03:52
|
Update of /cvsroot/mxbb/core/includes/db In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19942/db Modified Files: Tag: core28x dbal.php firebird.php mssql.php mssql_odbc.php mysql.php mysql4.php mysqli.php oracle.php postgres.php sqlite.php Log Message: sincronization with 2.9.2 Index: mysqli.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/mysqli.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** mysqli.php 6 Aug 2007 20:07:04 -0000 1.8 --- mysqli.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 35,38 **** --- 35,39 ---- class dbal_mysqli extends dbal { + var $multi_insert = true; /** * Connect to server *************** *** 59,62 **** --- 60,71 ---- /** + * Version information about used database + */ + function sql_server_info() + { + return 'MySQL(i) ' . @mysqli_get_server_info($this->db_connect_id); + } + + /** * sql transaction */ Index: sqlite.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/sqlite.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** sqlite.php 6 Aug 2007 20:07:05 -0000 1.8 --- sqlite.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 55,58 **** --- 55,66 ---- /** + * Version information about used database + */ + function sql_server_info() + { + return 'SQLite ' . @sqlite_libversion(); + } + + /** * sql transaction */ Index: postgres.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/postgres.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** postgres.php 6 Aug 2007 20:07:05 -0000 1.8 --- postgres.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 35,38 **** --- 35,39 ---- { var $last_query_text = ''; + var $pgsql_version; /** *************** *** 88,91 **** --- 89,100 ---- /** + * Version information about used database + */ + function sql_server_info() + { + return 'PostgreSQL ' . $this->pgsql_version; + } + + /** * sql transaction */ Index: mysql4.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/mysql4.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** mysql4.php 6 Aug 2007 20:07:04 -0000 1.8 --- mysql4.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 37,40 **** --- 37,42 ---- class dbal_mysql4 extends dbal { + var $mysql_version; + var $multi_insert = true; /** * Connect to server *************** *** 61,64 **** --- 63,74 ---- /** + * Version information about used database + */ + function sql_server_info() + { + return 'MySQL ' . $this->mysql_version; + } + + /** * sql transaction */ Index: firebird.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/firebird.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** firebird.php 6 Aug 2007 20:07:04 -0000 1.8 --- firebird.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 52,55 **** --- 52,72 ---- /** + * Connect to server + */ + function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) + { + $this->persistency = $persistency; + $this->user = $sqluser; + $this->server = $sqlserver . (($port) ? ':' . $port : ''); + $this->dbname = $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); + + $this->service_handle = (function_exists('ibase_service_attach')) ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false; + + return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); + } + + /** * sql transaction */ Index: mssql.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/mssql.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** mssql.php 6 Aug 2007 20:07:04 -0000 1.8 --- mssql.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 59,62 **** --- 59,84 ---- /** + * Version information about used database + */ + function sql_server_info() + { + $result_id = @mssql_query("SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')", $this->db_connect_id); + + $row = false; + if ($result_id) + { + $row = @mssql_fetch_assoc($result_id); + @mssql_free_result($result_id); + } + + if ($row) + { + return 'MSSQL<br />' . implode(' ', $row); + } + + return 'MSSQL'; + } + + /** * sql transaction */ Index: mysql.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/mysql.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** mysql.php 6 Aug 2007 20:07:04 -0000 1.8 --- mysql.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 34,37 **** --- 34,39 ---- class dbal_mysql extends dbal { + var $mysql_version; + var $multi_insert = true; /** * Connect to server *************** *** 59,62 **** --- 61,72 ---- /** + * Version information about used database + */ + function sql_server_info() + { + return 'MySQL ' . $this->mysql_version; + } + + /** * sql transaction */ Index: dbal.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/dbal.php,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** dbal.php 6 Aug 2007 20:07:03 -0000 1.6 --- dbal.php 16 Jan 2008 04:03:46 -0000 1.6.2.1 *************** *** 42,45 **** --- 42,65 ---- /** + * Constructor + */ + function dbal() + { + $this->num_queries = array( + 'cached' => 0, + 'normal' => 0, + 'total' => 0, + ); + + // Fill default sql layer based on the class being called. + // This can be changed by the specified layer itself later if needed. + $this->sql_layer = substr(get_class($this), 5); + + // Do not change this please! This variable is used to easy the use of it - and is hardcoded. + $this->any_char = chr(0) . '%'; + $this->one_char = chr(0) . '_'; + } + + /** * return on error or display error message */ Index: oracle.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/oracle.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** oracle.php 6 Aug 2007 20:07:05 -0000 1.8 --- oracle.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 51,54 **** --- 51,62 ---- /** + * Version information about used database + */ + function sql_server_info() + { + return @ociserverversion($this->db_connect_id); + } + + /** * sql transaction */ Index: mssql_odbc.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/mssql_odbc.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** mssql_odbc.php 6 Aug 2007 20:07:04 -0000 1.8 --- mssql_odbc.php 16 Jan 2008 04:03:46 -0000 1.8.2.1 *************** *** 53,56 **** --- 53,78 ---- /** + * Version information about used database + */ + function sql_server_info() + { + $result_id = @odbc_exec($this->db_connect_id, "SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')"); + + $row = false; + if ($result_id) + { + $row = @odbc_fetch_array($result_id); + @odbc_free_result($result_id); + } + + if ($row) + { + return 'MSSQL (ODBC)<br />' . implode(' ', $row); + } + + return 'MSSQL (ODBC)'; + } + + /** * sql transaction */ |