[Openfirst-cvscommit] SF.net SVN: openfirst: [174] trunk/src/includes
Brought to you by:
xtimg
From: <ast...@us...> - 2006-06-21 22:16:59
|
Revision: 174 Author: astronouth7303 Date: 2006-06-21 15:16:55 -0700 (Wed, 21 Jun 2006) ViewCVS: http://svn.sourceforge.net/openfirst/?rev=174&view=rev Log Message: ----------- Implemented check() Modified Paths: -------------- trunk/src/includes/MSSQLDataBase.php trunk/src/includes/MySQLDataBase.php trunk/src/includes/ODBCDataBase.php Modified: trunk/src/includes/MSSQLDataBase.php =================================================================== --- trunk/src/includes/MSSQLDataBase.php 2006-06-21 21:45:45 UTC (rev 173) +++ trunk/src/includes/MSSQLDataBase.php 2006-06-21 22:16:55 UTC (rev 174) @@ -27,8 +27,14 @@ class MSSQLDataBase extends DataBase { /*private*/ var $type, $connection, $lastquery, $db; + + function MSSQLDataBase() { + $args = func_get_args(); + call_user_func_array(array(&$this, '__construct'), $args); + } + // Wrapper for database selection. - function MSSQLDataBase($type = dbMSSQL, $server = false, $username = false, $password = false, $newlink = false, $flags = false) { + function __construct($type = dbMSSQL, $server = false, $username = false, $password = false, $newlink = false, $flags = false) { $this->type = dbMSSQL; global $sqlTablePrefix; $this->prefix = $sqlTablePrefix; @@ -106,6 +112,10 @@ } } + function check() { + return $this->connection !== false; + } + function fetchObject($resource, $rownumber = false) { $this->checkForFunction('mssql_fetch_object'); return mssql_fetch_object($resource); @@ -150,7 +160,7 @@ # Check if there the connection is valid function check() { - #TODO: Write me! + return $this->connection !== false && is_resource($this->connection); } function escape($text) { Modified: trunk/src/includes/MySQLDataBase.php =================================================================== --- trunk/src/includes/MySQLDataBase.php 2006-06-21 21:45:45 UTC (rev 173) +++ trunk/src/includes/MySQLDataBase.php 2006-06-21 22:16:55 UTC (rev 174) @@ -123,11 +123,11 @@ # Check if there the connection is valid function check() { - #TODO: Write me! + return $this->connection !== false && is_resource($this->connection) && @mysql_ping($this->connection); } function escape($text) { - return mysql_real_escape_string($text); + return mysql_real_escape_string($text, $this->connection); } /** SQL escaping and quoting. Modified: trunk/src/includes/ODBCDataBase.php =================================================================== --- trunk/src/includes/ODBCDataBase.php 2006-06-21 21:45:45 UTC (rev 173) +++ trunk/src/includes/ODBCDataBase.php 2006-06-21 22:16:55 UTC (rev 174) @@ -109,7 +109,7 @@ # Check if there the connection is valid function check() { - #TODO: Write me! + return $this->connection != false && is_resource($this->connection); } function quoteName($name, $delimiter = ',') { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |