From 6207216296ed3f6840ef03c36c8a1955d2964c39 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Tue, 22 Jan 2008 08:19:52 +0000 Subject: [PATCH] differ between PHP and SQL debugging --- Documentation.html | 15 ++++++++++----- libraries/config.default.php | 15 +++++++++++---- libraries/dbg/setup.php | 2 +- libraries/dbi/mysql.dbi.lib.php | 4 ++-- libraries/dbi/mysqli.dbi.lib.php | 4 ++-- libraries/footer.inc.php | 4 ++-- 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/Documentation.html b/Documentation.html index 3702d653d..f8be520da 100644 --- a/Documentation.html +++ b/Documentation.html @@ -1532,12 +1532,12 @@ $cfg['TrustedProxies'] =
$cfg['CheckConfigurationPermissions'] boolean
We normally check the permissions on the configuration file to ensure - it's not world writable. However, phpMyAdmin could be installed on + it's not world writable. However, phpMyAdmin could be installed on a NTFS filesystem mounted on a non-Windows server, in which case the permissions seems wrong but in fact cannot be detected. In this case a sysadmin would set this parameter to FALSE. Default is TRUE.
- +
$cfg['NaviWidth'] integer
Navi frame width in pixels. See themes/themename/layout.inc.php.
@@ -2010,7 +2010,12 @@ $cfg['TrustedProxies'] =
$cfg['DBG']
DEVELOPERS ONLY!
-
$cfg['DBG']['enable'] boolean
+
$cfg['DBG']['sql'] boolean
+
DEVELOPERS ONLY!
+ Enable logging queries and execution times to be displayed in the bottom + of main (right frame).
+ +
$cfg['DBG']['php'] boolean
DEVELOPERS ONLY!
Enable the DBG extension for debugging phpMyAdmin. Required for profiling the code.
@@ -2023,8 +2028,8 @@ $cfg['TrustedProxies'] = to the end of every page displayed in the main window with profiling statistics for that page.
You may need to increase the maximum execution time for this to - complete successfully.Profiling was removed from the code for - version 2.9.0 due to licensing issues.
+ complete successfully.Profiling was removed from the code for + version 2.9.0 due to licensing issues.
$cfg['DBG']['profile']['threshold'] float (units in milliseconds)
DEVELOPERS ONLY!
diff --git a/libraries/config.default.php b/libraries/config.default.php index 213e5f850..95ea636fc 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -1983,7 +1983,7 @@ $cfg['NaturalOrder'] = true; /** * Initial status for sliders - * (open | closed) + * (open | closed) * * @global string $cfg['InitialSlidersStatus'] */ @@ -2282,18 +2282,25 @@ $cfg['SQLValidator']['password'] = ''; /******************************************************************************* * Developers ONLY! - * To use the following, please install the DBG extension from http://dd.cron.ru/dbg/ * * @global array $cfg['DBG'] */ $cfg['DBG'] = array(); /** - * Make the DBG stuff available + * Output executed queries and their execution times * * @global boolean $cfg['DBG']['enable'] */ -$cfg['DBG']['enable'] = false; +$cfg['DBG']['sql'] = false; + +/** + * Make the DBG stuff available + * To use the following, please install the DBG extension from http://dd.cron.ru/dbg/ + * + * @global boolean $cfg['DBG']['enable'] + */ +$cfg['DBG']['php'] = false; /** * Produce profiling results of PHP diff --git a/libraries/dbg/setup.php b/libraries/dbg/setup.php index b30273ee2..ba374b1d5 100644 --- a/libraries/dbg/setup.php +++ b/libraries/dbg/setup.php @@ -10,7 +10,7 @@ * allways use $GLOBALS here, as this script is included by footer.inc.hp * which can also be included from inside a function */ -if ($GLOBALS['cfg']['DBG']['enable']) { +if ($GLOBALS['cfg']['DBG']['php']) { /** * Loads the DBG extension if needed */ diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php index 818930b73..21eacc501 100644 --- a/libraries/dbi/mysql.dbi.lib.php +++ b/libraries/dbi/mysql.dbi.lib.php @@ -126,7 +126,7 @@ function PMA_DBI_try_query($query, $link = null, $options = 0) } } - if ($GLOBALS['cfg']['DBG']['enable']) { + if ($GLOBALS['cfg']['DBG']['sql']) { $time = microtime(true); } if ($options == ($options | PMA_DBI_QUERY_STORE)) { @@ -137,7 +137,7 @@ function PMA_DBI_try_query($query, $link = null, $options = 0) $r = mysql_query($query, $link); } - if ($GLOBALS['cfg']['DBG']['enable']) { + if ($GLOBALS['cfg']['DBG']['sql']) { $time = microtime(true) - $time; $hash = md5($query); diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php index 99b111e0d..f4ac69ea7 100644 --- a/libraries/dbi/mysqli.dbi.lib.php +++ b/libraries/dbi/mysqli.dbi.lib.php @@ -175,11 +175,11 @@ function PMA_DBI_try_query($query, $link = null, $options = 0) } } - if ($GLOBALS['cfg']['DBG']['enable']) { + if ($GLOBALS['cfg']['DBG']['sql']) { $time = microtime(true); } $r = mysqli_query($link, $query, $method); - if ($GLOBALS['cfg']['DBG']['enable']) { + if ($GLOBALS['cfg']['DBG']['sql']) { $time = microtime(true) - $time; $hash = md5($query); diff --git a/libraries/footer.inc.php b/libraries/footer.inc.php index 76811f057..4ffb6ac84 100644 --- a/libraries/footer.inc.php +++ b/libraries/footer.inc.php @@ -193,8 +193,8 @@ if (file_exists('./config.footer.inc.php')) { */ // profiling deactivated due to licensing issues -if (! empty($GLOBALS['cfg']['DBG']['enable']) - && ! empty($GLOBALS['cfg']['DBG']['profile']['enable'])) { +if (! empty($GLOBALS['cfg']['DBG']['php']) + && ! empty($GLOBALS['cfg']['DBG']['profile']['enable'])) { //run the basic setup code first require_once './libraries/dbg/setup.php'; //if the setup ran fine, then do the profiling