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('<pre>'.linenumberCode($code).'</pre>');
+ //* DEBUG: */ debugOutput('<pre>'.lineNumberCode($code).'</pre>');
$eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code), $enableCodes)) . '";';
- //* DEBUG: */ if (!$insertComments) print('EVAL=<pre>'.linenumberCode($eval).'</pre>');
+ //* DEBUG: */ if (!$insertComments) print('EVAL=<pre>'.lineNumberCode($eval).'</pre>');
eval($eval);
- //* DEBUG: */ if (!$insertComments) print('NEW=<pre>'.linenumberCode($newContent).'</pre>');
+ //* DEBUG: */ if (!$insertComments) print('NEW=<pre>'.lineNumberCode($newContent).'</pre>');
//* DEBUG: */ die('<pre>'.encodeEntities($newContent).'</pre>');
// Was that eval okay?
if (empty($newContent)) {
// Something went wrong!
- reportBug(__FUNCTION__, __LINE__, 'Evaluation error:<pre>' . linenumberCode($eval) . '</pre>', FALSE);
+ reportBug(__FUNCTION__, __LINE__, 'Evaluation error:<pre>' . lineNumberCode($eval) . '</pre>', FALSE);
} // END - if
// Use it again
} // 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 .= '<!-- Total compilation loop=' . $count . ' //-->';
+ $code .= '<!-- Total compilation loop=' . $totalCompilations . ' //-->';
} // END - if
// Return the compiled code
// 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
}
/**
}
// Print code with line numbers
-function linenumberCode ($code) {
+function lineNumberCode ($code) {
// By default copy the code
$codeE = $code;