[Openfirst-cvscommit] SF.net SVN: openfirst: [185] trunk/src/includes
Brought to you by:
xtimg
From: <ast...@us...> - 2006-06-22 22:52:34
|
Revision: 185 Author: astronouth7303 Date: 2006-06-22 15:52:27 -0700 (Thu, 22 Jun 2006) ViewCVS: http://svn.sourceforge.net/openfirst/?rev=185&view=rev Log Message: ----------- Fixing inheritance. Modified Paths: -------------- trunk/src/includes/MSSQLDataBase.php trunk/src/includes/MySQLDataBase.php trunk/src/includes/ODBCDataBase.php trunk/src/includes/dbase.php Modified: trunk/src/includes/MSSQLDataBase.php =================================================================== --- trunk/src/includes/MSSQLDataBase.php 2006-06-22 22:18:39 UTC (rev 184) +++ trunk/src/includes/MSSQLDataBase.php 2006-06-22 22:52:27 UTC (rev 185) @@ -26,7 +26,7 @@ require_once('dbase.php'); class MSSQLDataBase extends DataBase { - /*private*/ var $type, $connection, $lastquery, $db; + /*private*/ /*var $type, $connection, $lastquery, $db;*/ function MSSQLDataBase() { $args = func_get_args(); @@ -35,9 +35,8 @@ // Wrapper for database selection. function __construct($type = dbMSSQL, $server = false, $username = false, $password = false, $newlink = false, $flags = false) { + parent::__construct(); $this->type = dbMSSQL; - global $sqlTablePrefix; - $this->prefix = $sqlTablePrefix; $this->checkForFunction('mssql_connect'); $this->connection = mssql_connect($server, $username, $password); } Modified: trunk/src/includes/MySQLDataBase.php =================================================================== --- trunk/src/includes/MySQLDataBase.php 2006-06-22 22:18:39 UTC (rev 184) +++ trunk/src/includes/MySQLDataBase.php 2006-06-22 22:52:27 UTC (rev 185) @@ -26,12 +26,16 @@ require_once('dbase.php'); class MySQLDataBase extends DataBase { - /*private*/ var $type, $connection, $lastquery, $db, $prefix; + /*private*/ /*var $type, $connection, $lastquery, $db, $prefix;*/ + function MySQLDataBase() { + $args = func_get_args(); + call_user_func_array(array(&$this, '__construct'), $args); + } + // Wrapper for database selection. - function MySQLDataBase($type = dbMYSQL, $server = false, $username = false, $password = false, $newlink = false, $flags = false) { + function __construct($type = dbMYSQL, $server = false, $username = false, $password = false, $newlink = false, $flags = false) { + parent::__construct($type, $server, $username, $password, $newlink, $flags); $this->type = dbMYSQL; - global $sqlTablePrefix; - $this->prefix = $sqlTablePrefix; $this->checkForFunction('mysql_connect'); if($flags !== false) { $this->connection = mysql_connect($server, $username, $password, $newlink, $flags); Modified: trunk/src/includes/ODBCDataBase.php =================================================================== --- trunk/src/includes/ODBCDataBase.php 2006-06-22 22:18:39 UTC (rev 184) +++ trunk/src/includes/ODBCDataBase.php 2006-06-22 22:52:27 UTC (rev 185) @@ -26,13 +26,16 @@ require_once('dbase.php'); class ODBCDataBase extends DataBase { - /*private*/ var $type, $connection, $lastquery, $db, $prefix; + /*private*/ /*var $type, $connection, $lastquery, $db, $prefix;*/ + function ODBCDataBase() { + $args = func_get_args(); + call_user_func_array(array(&$this, '__construct'), $args); + } + // Wrapper for database selection. - function ODBCDataBase($type = dbMYSQL, $server = '', $username = '', $password = '', $newlink = false, $flags = null) { - $this->type = $type; - global $sqlTablePrefix; - $this->prefix = $sqlTablePrefix; - + function __construct($type = dbODBC, $server = '', $username = '', $password = '', $newlink = false, $flags = null) { + parent::__construct($type, $server, $username, $password, $newlink, $flags); + $this->type = dbODBC; $this->checkForFunction('odbc_connect'); if($newlink !== false) { $this->connection = odbc_connect($server, $username, $password, $newlink); Modified: trunk/src/includes/dbase.php =================================================================== --- trunk/src/includes/dbase.php 2006-06-22 22:18:39 UTC (rev 184) +++ trunk/src/includes/dbase.php 2006-06-22 22:52:27 UTC (rev 185) @@ -51,8 +51,12 @@ */ class DataBase { /*private*/ var $type, $connection, $lastquery, $db, $prefix, $overrides; + function DataBase($type = dbUNKNOWN, $server = '', $username = '', $password = '', $newlink = '', $flags = '') { + $args = func_get_args(); + call_user_func_array(array(&$this, '__construct'), $args); + } // Wrapper for database selection. - function DataBase($type = dbUNKNOWN, $server = '', $username = '', $password = '', $newlink = '', $flags = '') { + function __construct($type = dbUNKNOWN, $server = '', $username = '', $password = '', $newlink = '', $flags = '') { $this->type = $type; global $sqlTablePrefix; $this->prefix = $sqlTablePrefix; @@ -548,7 +552,7 @@ $scol .= $this->quoteField($col->getName()).' '; } $type = $col->getType(); - if (in_array(strtolower($type), $this->overrides)) { + if (array_key_exists(strtolower($type), $this->overrides)) { $type = $this->overrides[strtolower($type)]; } if ($type == 'SET' || $type == 'ENUM') { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |