summaryrefslogtreecommitdiffstats
path: root/lib/class/dba.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-05-12 02:52:50 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-05-12 02:52:50 +0000
commit693e26e2ad074f8cc9d37098a0568cd93ae30f52 (patch)
tree8588523335a337d0971df768da0456e325bb6b66 /lib/class/dba.class.php
parent003619c52c0370f03b9edb466addaaebac13ce41 (diff)
downloadampache-693e26e2ad074f8cc9d37098a0568cd93ae30f52.tar.gz
ampache-693e26e2ad074f8cc9d37098a0568cd93ae30f52.tar.bz2
ampache-693e26e2ad074f8cc9d37098a0568cd93ae30f52.zip
commit of the patches from codeoverload to implement tagging, will not work without manual modification of database, yes.. this commit breaks things cope
Diffstat (limited to 'lib/class/dba.class.php')
-rw-r--r--lib/class/dba.class.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/class/dba.class.php b/lib/class/dba.class.php
index 62df46fe..6515b71f 100644
--- a/lib/class/dba.class.php
+++ b/lib/class/dba.class.php
@@ -53,7 +53,10 @@ class Dba {
* The mysql_query function
*/
public static function query($sql) {
-
+ /*if ($_REQUEST['profiling']) {
+ $sql = rtrim($sql, '; ');
+ $sql .= ' SQL_NO_CACHE';
+ }*/
// Run the query
$resource = mysql_query($sql,self::dbh());
debug_event('Query',$sql,'6');
@@ -188,10 +191,26 @@ class Dba {
$select_db = mysql_select_db($database,$dbh);
if (!$select_db) { debug_event('Database','Error unable to select ' . $database . ' error ' . mysql_error(),'1'); }
+ if ($_REQUEST['profiling']) {
+ mysql_query('set profiling=1', $dbh);
+ mysql_query('set profiling_history_size=50', $dbh);
+ mysql_query('set query_cache_type=0', $dbh);
+ }
return $dbh;
} // _connect
+ public static function show_profile() {
+ if ($_REQUEST['profiling']) {
+ print '<br/>Profiling data: <br/>';
+ $res = Dba::query('show profiles');
+ print '<table>';
+ while ($r = Dba::fetch_row($res)) {
+ print '<tr><td>' . implode('</td><td>', $r) . '</td></tr>';
+ }
+ print '</table>';
+ }
+ }
/**
* dbh
* This is called by the class to return the database handle