[Openfirst-cvscommit] SF.net SVN: openfirst: [230] trunk/src/includes/MySQLDataBase.php
Brought to you by:
xtimg
From: <ast...@us...> - 2007-06-24 02:30:28
|
Revision: 230 http://svn.sourceforge.net/openfirst/?rev=230&view=rev Author: astronouth7303 Date: 2007-06-23 19:30:31 -0700 (Sat, 23 Jun 2007) Log Message: ----------- Spacing. Modified Paths: -------------- trunk/src/includes/MySQLDataBase.php Modified: trunk/src/includes/MySQLDataBase.php =================================================================== --- trunk/src/includes/MySQLDataBase.php 2007-06-24 02:12:51 UTC (rev 229) +++ trunk/src/includes/MySQLDataBase.php 2007-06-24 02:30:31 UTC (rev 230) @@ -28,13 +28,13 @@ class MySQLDataBase extends DataBase { /*private*/ /*var $type, $connection, $lastquery, $db, $prefix;*/ function MySQLDataBase() { - $args = func_get_args(); - call_user_func_array(array(&$this, '__construct'), $args); + $args = func_get_args(); + call_user_func_array(array(&$this, '__construct'), $args); } // Wrapper for database selection. function __construct($type = dbMYSQL, $server = false, $username = false, $password = false, $newlink = false, $flags = false) { - parent::__construct($type, $server, $username, $password, $newlink, $flags); + parent::__construct($type, $server, $username, $password, $newlink, $flags); $this->type = dbMYSQL; $this->checkForFunction('mysql_connect'); if($flags !== false) { @@ -50,18 +50,18 @@ return new MySQLDataBase(dbMYSQL, $server, $username, $password, $newlink, $flags); } - /** - * Called in PHP5 when you clone an object to re-initialize properties. - * Needed primarily because otherwise error numbers and such would get mixed up. - */ - function __clone() { - if($this->flags !== false) { - $this->connection = mysql_connect($this->server, $this->username, $this->password, true, $this->flags); - } else { - $this->connection = mysql_connect($this->server, $this->username, $this->password); - } - } - + /** + * Called in PHP5 when you clone an object to re-initialize properties. + * Needed primarily because otherwise error numbers and such would get mixed up. + */ + function __clone() { + if($this->flags !== false) { + $this->connection = mysql_connect($this->server, $this->username, $this->password, true, $this->flags); + } else { + $this->connection = mysql_connect($this->server, $this->username, $this->password); + } + } + /*public*/ function getTypeName() { return 'MySQL'; } @@ -139,11 +139,11 @@ # Check if there the connection is valid function check() { - return $this->connection !== false && is_resource($this->connection) && @mysql_ping($this->connection); + return $this->connection !== false && is_resource($this->connection) && @mysql_ping($this->connection); } function escape($text) { - return mysql_real_escape_string($text, $this->connection); + return mysql_real_escape_string($text, $this->connection); } /** SQL escaping and quoting. @@ -281,4 +281,5 @@ return true; } } +# vim:set expandtab tabwidth=2 : ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |