mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 09:49:22 +02:00
Log database queries into database.log when enabled
Instead of showing in page sources (it was impractical)
This commit is contained in:
parent
f3ddf631c1
commit
e11d70de46
@ -386,10 +386,6 @@ if(superAdmin()) {
|
|||||||
if(function_exists('memory_get_peak_usage')) {
|
if(function_exists('memory_get_peak_usage')) {
|
||||||
echo PHP_EOL . '<!-- Peak memory usage: ' . convert_bytes(memory_get_peak_usage(true)) . ' -->';
|
echo PHP_EOL . '<!-- Peak memory usage: ' . convert_bytes(memory_get_peak_usage(true)) . ' -->';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($config['database_log']) {
|
|
||||||
echo PHP_EOL . '<!-- List of MySQL queries done:' . PHP_EOL . $db->getLog() . '-->';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$hooks->trigger(HOOK_FINISH);
|
$hooks->trigger(HOOK_FINISH);
|
||||||
|
@ -149,6 +149,10 @@ class OTS_DB_MySQL extends OTS_Base_DB
|
|||||||
$cache->set('database_columns', serialize($this->has_column_cache));
|
$cache->set('database_columns', serialize($this->has_column_cache));
|
||||||
$cache->set('database_checksum', serialize(sha1($config['database_host'] . '.' . $config['database_name'])));
|
$cache->set('database_checksum', serialize(sha1($config['database_host'] . '.' . $config['database_name'])));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->logged) {
|
||||||
|
log_append('database.log', PHP_EOL . $this->getLog());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user