mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-28 14:52:24 +09:00
#107 mysqli innodb class 개발
This commit is contained in:
commit
285797e777
6 changed files with 668 additions and 10 deletions
|
|
@ -57,7 +57,8 @@ class DB
|
|||
* @var array
|
||||
*/
|
||||
var $priority_dbms = array(
|
||||
'mysqli' => 5,
|
||||
'mysqli' => 6,
|
||||
'mysqli_innodb' => 5,
|
||||
'mysql' => 4,
|
||||
'mysql_innodb' => 3,
|
||||
'cubrid' => 2,
|
||||
|
|
@ -468,7 +469,8 @@ class DB
|
|||
{
|
||||
$log['result'] = 'Success';
|
||||
}
|
||||
$GLOBALS['__db_queries__'][] = $log;
|
||||
|
||||
$this->setQueryLog($log);
|
||||
|
||||
// if __LOG_SLOW_QUERY__ if defined, check elapsed time and leave query log
|
||||
if(__LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__)
|
||||
|
|
@ -486,6 +488,16 @@ class DB
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* set query debug log
|
||||
* @param array $log values set query debug
|
||||
* @return void
|
||||
*/
|
||||
function setQueryLog($log)
|
||||
{
|
||||
$GLOBALS['__db_queries__'][] = $log;
|
||||
}
|
||||
|
||||
/**
|
||||
* set error
|
||||
* @param int $errno error code
|
||||
|
|
@ -1092,6 +1104,7 @@ class DB
|
|||
$connection = &$this->slave_db[$indx];
|
||||
}
|
||||
|
||||
$this->commit();
|
||||
$this->_close($connection["resource"]);
|
||||
|
||||
$connection["is_connected"] = FALSE;
|
||||
|
|
@ -1316,6 +1329,9 @@ class DB
|
|||
// Save connection info for db logs
|
||||
$this->connection = ucfirst($type) . ' ' . $connection["db_hostname"];
|
||||
|
||||
// regist $this->close callback
|
||||
register_shutdown_function(array($this, "close"));
|
||||
|
||||
$this->_afterConnect($result);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue