mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
db class renamed to e_db_mysql, prepare for different SQL layers; started phpDoc cleanup
This commit is contained in:
@@ -9,9 +9,9 @@
|
|||||||
* mySQL Handler
|
* mySQL Handler
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $
|
||||||
* $Revision: 1.48 $
|
* $Revision: 1.49 $
|
||||||
* $Date: 2009-09-06 20:04:03 $
|
* $Date: 2009-09-10 12:06:39 $
|
||||||
* $Author: e107coders $
|
* $Author: secretr $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(defined('MYSQL_LIGHT'))
|
if(defined('MYSQL_LIGHT'))
|
||||||
@@ -58,13 +58,15 @@ $db_mySQLQueryCount = 0; // Global total number of db object queries (all db's)
|
|||||||
$db_ConnectionID = NULL; // Stores ID for the first DB connection used - which should be the main E107 DB - then used as default
|
$db_ConnectionID = NULL; // Stores ID for the first DB connection used - which should be the main E107 DB - then used as default
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MySQL Abstraction class
|
* MySQL Abstraction class
|
||||||
*
|
*
|
||||||
* @package e107
|
* @package e107
|
||||||
* @version $Revision: 1.48 $
|
* @category e107_handlers
|
||||||
* @author $Author: e107coders $
|
* @version $Revision: 1.49 $
|
||||||
*/
|
* @author $Author: secretr $
|
||||||
class db {
|
*
|
||||||
|
*/
|
||||||
|
class e_db_mysql {
|
||||||
|
|
||||||
var $mySQLserver;
|
var $mySQLserver;
|
||||||
var $mySQLuser;
|
var $mySQLuser;
|
||||||
@@ -87,16 +89,15 @@ class db {
|
|||||||
/**
|
/**
|
||||||
* @public MySQL Charset
|
* @public MySQL Charset
|
||||||
**/
|
**/
|
||||||
var $mySQLcharset;
|
public $mySQLcharset;
|
||||||
|
|
||||||
var $total_results; // Total number of results
|
var $total_results; // Total number of results
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return db
|
* Constructor - gets language options from the cookie or session
|
||||||
* @desc db constructor gets language options from the cookie or session
|
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function db()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|
||||||
global $pref, $eTraffic, $db_defaultPrefix;
|
global $pref, $eTraffic, $db_defaultPrefix;
|
||||||
@@ -117,7 +118,6 @@ class db {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @access public
|
|
||||||
* Connects to mySQL server and selects database - generally not required if your table is in the main DB.<br />
|
* Connects to mySQL server and selects database - generally not required if your table is in the main DB.<br />
|
||||||
* <br />
|
* <br />
|
||||||
* Example using e107 database with variables defined in e107_config.php:<br />
|
* Example using e107 database with variables defined in e107_config.php:<br />
|
||||||
@@ -136,7 +136,7 @@ class db {
|
|||||||
* @param string $mySQLPrefix Tables prefix. Default to $mySQLPrefix from e107_config.php
|
* @param string $mySQLPrefix Tables prefix. Default to $mySQLPrefix from e107_config.php
|
||||||
* @return null|string error code
|
* @return null|string error code
|
||||||
*/
|
*/
|
||||||
function db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb, $newLink = FALSE, $mySQLPrefix = MPREFIX)
|
public function db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb, $newLink = FALSE, $mySQLPrefix = MPREFIX)
|
||||||
{
|
{
|
||||||
global $eTraffic, $db_ConnectionID, $db_defaultPrefix;
|
global $eTraffic, $db_ConnectionID, $db_defaultPrefix;
|
||||||
$eTraffic->BumpWho('db Connect', 1);
|
$eTraffic->BumpWho('db Connect', 1);
|
||||||
@@ -228,14 +228,14 @@ class db {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return unknown
|
* @desc Enter description here...
|
||||||
|
* This is the 'core' routine which handles much of the interface between other functions and the DB
|
||||||
|
*
|
||||||
* @param unknown $query
|
* @param unknown $query
|
||||||
* @param unknown $rli
|
* @param unknown $rli
|
||||||
* @desc Enter description here...
|
* @return unknown
|
||||||
* @access private
|
|
||||||
* This is the 'core' routine which handles much of the interface between other functions and the DB
|
|
||||||
*/
|
*/
|
||||||
function db_Query($query, $rli = NULL, $qry_from = '', $debug = FALSE, $log_type = '', $log_remark = '')
|
protected function db_Query($query, $rli = NULL, $qry_from = '', $debug = FALSE, $log_type = '', $log_remark = '')
|
||||||
{
|
{
|
||||||
global $db_time,$db_mySQLQueryCount,$queryinfo, $eTraffic;
|
global $db_time,$db_mySQLQueryCount,$queryinfo, $eTraffic;
|
||||||
$db_mySQLQueryCount++;
|
$db_mySQLQueryCount++;
|
||||||
@@ -301,16 +301,7 @@ class db {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int Number of rows or false on error
|
* Perform a mysql_query() using the arguments suplied by calling db::db_Query()<br />
|
||||||
*
|
|
||||||
* @param string $table Table name to select data from
|
|
||||||
* @param string $fields Table fields to be retrieved, default * (all in table)
|
|
||||||
* @param string $arg Query arguments, default null
|
|
||||||
* @param string $mode Argument has WHERE or not, default=default (WHERE)
|
|
||||||
*
|
|
||||||
* @param bool $debug Debug mode on or off
|
|
||||||
*
|
|
||||||
* @desc Perform a mysql_query() using the arguments suplied by calling db::db_Query()<br />
|
|
||||||
* <br />
|
* <br />
|
||||||
* If you need more requests think to call the class.<br />
|
* If you need more requests think to call the class.<br />
|
||||||
* <br />
|
* <br />
|
||||||
@@ -321,9 +312,9 @@ class db {
|
|||||||
* <code>$sql2 = new db;
|
* <code>$sql2 = new db;
|
||||||
* $sql2->db_Select("chatbox", "*", "ORDER BY cb_datestamp DESC LIMIT $from, ".$view, 'no_where');</code>
|
* $sql2->db_Select("chatbox", "*", "ORDER BY cb_datestamp DESC LIMIT $from, ".$view, 'no_where');</code>
|
||||||
*
|
*
|
||||||
* @access public
|
* @return integer Number of rows or false on error
|
||||||
*/
|
*/
|
||||||
function db_Select($table, $fields = '*', $arg = '', $mode = 'default', $debug = FALSE, $log_type = '', $log_remark = '')
|
public function db_Select($table, $fields = '*', $arg = '', $mode = 'default', $debug = FALSE, $log_type = '', $log_remark = '')
|
||||||
{
|
{
|
||||||
global $db_mySQLQueryCount;
|
global $db_mySQLQueryCount;
|
||||||
|
|
||||||
@@ -1397,4 +1388,12 @@ class db {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BC
|
||||||
|
*/
|
||||||
|
class db extends e_db_mysql
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Reference in New Issue
Block a user