From 2f8a3c36ac4051c0f87a6eb50828f339f49fad3f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 22 Jan 2013 23:42:35 +0000 Subject: [PATCH] Renamed function, added noisy debug line, renamed variable to make it more clear --- inc/template-functions.php | 24 +++++++++++++++--------- templates/de/html/show_timings.tpl | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/inc/template-functions.php b/inc/template-functions.php index 474a86baf0..9e9a252d18 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -235,26 +235,26 @@ function doFinalCompilation ($code, $insertComments = TRUE, $enableCodes = TRUE) enableTemplateHtml($insertComments); // Init counter - $count = 0; + $totalCompilations = 0; // Compile all out - while (((isInString('{--', $code)) || (isInString('{DQUOTE}', $code)) || (isInString('{?', $code)) || (isInString('{%', $code) !== FALSE)) && ($count < 7)) { + while (((isInString('{--', $code)) || (isInString('{DQUOTE}', $code)) || (isInString('{?', $code)) || (isInString('{%', $code) !== FALSE)) && ($totalCompilations < 7)) { // Init common variables $content = array(); $newContent = ''; // Compile it - //* DEBUG: */ debugOutput('
'.linenumberCode($code).'
'); + //* DEBUG: */ debugOutput('
'.lineNumberCode($code).'
'); $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code), $enableCodes)) . '";'; - //* DEBUG: */ if (!$insertComments) print('EVAL=
'.linenumberCode($eval).'
'); + //* DEBUG: */ if (!$insertComments) print('EVAL=
'.lineNumberCode($eval).'
'); eval($eval); - //* DEBUG: */ if (!$insertComments) print('NEW=
'.linenumberCode($newContent).'
'); + //* DEBUG: */ if (!$insertComments) print('NEW=
'.lineNumberCode($newContent).'
'); //* DEBUG: */ die('
'.encodeEntities($newContent).'
'); // Was that eval okay? if (empty($newContent)) { // Something went wrong! - reportBug(__FUNCTION__, __LINE__, 'Evaluation error:
' . linenumberCode($eval) . '
', FALSE); + reportBug(__FUNCTION__, __LINE__, 'Evaluation error:
' . lineNumberCode($eval) . '
', FALSE); } // END - if // Use it again @@ -267,14 +267,14 @@ function doFinalCompilation ($code, $insertComments = TRUE, $enableCodes = TRUE) } // END - if // Count round - $count++; + $totalCompilations++; } // END - while // Add debugging data in HTML code, if mode is enabled if ((isDebugModeEnabled()) && ($insertComments === TRUE) && (isHtmlOutputMode())) { // Add loop count //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isDebugModeEnabled()=' . intval(isDebugModeEnabled()) . ',insertComments=' . intval($insertComments) . ',isHtmlOutputMode()=' . intval(isHtmlOutputMode())); - $code .= ''; + $code .= ''; } // END - if // Return the compiled code @@ -1241,6 +1241,12 @@ function displayParsingTime () { // Load the template $GLOBALS['__page_footer'] .= loadTemplate('show_timings', TRUE, $content); + + // Is debug enabled? + if (isDebugModeEnabled()) { + // Log loading of total includes + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Loaded includes: ' . count($GLOBALS['inc_loaded']) . ', readable files: ' . count($GLOBALS['file_readable'])); + } // END - if } /** @@ -1479,7 +1485,7 @@ function generateExtensionInactiveNotInstalledMessage ($ext_name) { } // Print code with line numbers -function linenumberCode ($code) { +function lineNumberCode ($code) { // By default copy the code $codeE = $code; diff --git a/templates/de/html/show_timings.tpl b/templates/de/html/show_timings.tpl index 5e888f6414..e145d20383 100644 --- a/templates/de/html/show_timings.tpl +++ b/templates/de/html/show_timings.tpl @@ -6,7 +6,7 @@
  • {--SHOW_TIMINGS_SQL_QUERIES--} - {?sql_count?} + {%config,translateComma=sql_count%}
  • {--SHOW_TIMINGS_SQL_TIME--} -- 2.39.5