mirror of
https://github.com/slawkens/myaac.git
synced 2025-11-27 21:56:50 +01:00
* cache $db->hasTable and $db->hasColumn functions
* changed tableExist and fieldExist to $db->hasTable(table) + $db->hasColumn(table, column) * new configurable: database_log - can log database queries and show in website source when logged as super admin * removed debug_level configurable, enabled by default when logged on super admin * added OTS_Account:getCountry() * added posibility to load OTS_Player partially, and without skills * (internal) changed depracated $ots->createObject() functions with their OTS_ equivalents * (internal) removed unused code
This commit is contained in:
@@ -37,6 +37,9 @@ abstract class OTS_Base_DB extends PDO implements IOTS_DB
|
||||
*/
|
||||
private $queries = 0;
|
||||
|
||||
protected $logged = false;
|
||||
private $log = '';
|
||||
|
||||
/**
|
||||
* Query-quoted field name.
|
||||
*
|
||||
@@ -96,6 +99,10 @@ abstract class OTS_Base_DB extends PDO implements IOTS_DB
|
||||
|
||||
public function query($query)
|
||||
{
|
||||
if($this->logged) {
|
||||
$this->log .= $query . PHP_EOL;
|
||||
}
|
||||
|
||||
$this->queries++;
|
||||
//echo $query . PHP_EOL;
|
||||
return parent::query($query);
|
||||
@@ -235,6 +242,10 @@ abstract class OTS_Base_DB extends PDO implements IOTS_DB
|
||||
public function queries() {
|
||||
return $this->queries;
|
||||
}
|
||||
|
||||
public function getLog() {
|
||||
return $this->log;
|
||||
}
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
Reference in New Issue
Block a user