differ between PHP and SQL debugging

This commit is contained in:
Sebastian Mendel
2008-01-22 08:19:52 +00:00
parent bb5465e95d
commit 6207216296
6 changed files with 28 additions and 16 deletions

View File

@@ -2010,7 +2010,12 @@ $cfg['TrustedProxies'] =
<dt id="cfg_DBG">$cfg['DBG']</dt>
<dd><b>DEVELOPERS ONLY!</b></dd>
<dt id="cfg_DBG_enable">$cfg['DBG']['enable'] boolean</dt>
<dt id="cfg_DBG_enable">$cfg['DBG']['sql'] boolean</dt>
<dd><b>DEVELOPERS ONLY!</b><br />
Enable logging queries and execution times to be displayed in the bottom
of main (right frame).</dd>
<dt id="cfg_DBG_enable">$cfg['DBG']['php'] boolean</dt>
<dd><b>DEVELOPERS ONLY!</b><br />
Enable the DBG extension for debugging phpMyAdmin. Required for profiling
the code.<br />

View File

@@ -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

View File

@@ -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
*/

View File

@@ -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);

View File

@@ -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);

View File

@@ -193,7 +193,7 @@ if (file_exists('./config.footer.inc.php')) {
*/
// profiling deactivated due to licensing issues
if (! empty($GLOBALS['cfg']['DBG']['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';