// Main compilation loop
function doFinalCompilation ($code, $insertComments = true) {
- // Insert comments?
+ // Insert comments? (Only valid with HTML templates, of course)
enableTemplateHtml($insertComments);
// Init counter
// Compile it
//* DEBUG: */ print '<pre>'.htmlentities($code).'</pre>';
$eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code))) . '";';
- //* DEBUG: */ die('<pre>'.htmlentities($eval).'</pre>');
+ //* DEBUG: */ if ($insertComments) die('<pre>'.linenumberCode($eval).'</pre>');
eval($eval);
//* DEBUG: */ die('<pre>'.htmlentities($newContent).'</pre>');
// Simple probe for bots/spiders from search engines
if ((isSpider()) && ($allowSpider === true)) {
+ // Set HTTP-Status
+ setHttpStatus('200 OK');
+
// Set content-type here to fix a missing array element
setContentType('text/html');
// Back-ported from the new ship-simu engine. :-)
function debug_get_printable_backtrace () {
// Init variable
- $backtrace = "<ol>\n";
+ $backtrace = '<ol>';
// Get and prepare backtrace for output
$backtraceArray = debug_backtrace();
if (!isset($trace['file'])) $trace['file'] = __FUNCTION__;
if (!isset($trace['line'])) $trace['line'] = __LINE__;
if (!isset($trace['args'])) $trace['args'] = array();
- $backtrace .= "<li class=\"debug_list\"><span class=\"backtrace_file\">".basename($trace['file'])."</span>:" . $trace['line'].", <span class=\"backtrace_function\">" . $trace['function'].'('.count($trace['args']).")</span></li>\n";
+ $backtrace .= '<li class="debug_list"><span class="backtrace_file">' . basename($trace['file']) . '</span>:' . $trace['line'].", <span class=\"backtrace_function\">" . $trace['function'] . '(' . count($trace['args']) . ')</span></li>';
} // END - foreach
// Close it
- $backtrace .= "</ol>\n";
+ $backtrace .= '</ol>';
// Return the backtrace
return $backtrace;
} // END - if
// Add output
- $debug .= "Please report this bug at <a title=\"Direct link to the bug-tracker\" href=\"http://bugs.mxchange.org\" rel=\"external\" target=\"_blank\">http://bugs.mxchange.org</a> and include the logfile from <strong>" . str_replace(getConfig('PATH'), '', getConfig('CACHE_PATH')) . "debug.log</strong> in your report (you can now attach files):<pre>";
+ $debug .= 'Please report this bug at <a title="Direct link to the bug-tracker" href="http://bugs.mxchange.org" rel="external" target="_blank">http://bugs.mxchange.org</a> and include the logfile from <strong>' . str_replace(getConfig('PATH'), '', getConfig('CACHE_PATH')) . 'debug.log</strong> in your report (you can now attach files):<pre>';
$debug .= debug_get_printable_backtrace();
- $debug .= "</pre>\nRequest-URI: " . getRequestUri()."<br />\n";
- $debug .= "Thank you for finding bugs.";
+ $debug .= '</pre>Request-URI: ' . getRequestUri() . '<br />';
+ $debug .= 'Thank you for finding bugs.';
// Send an email? (e.g. not wanted for evaluation errors)
if (($sendEmail === true) && (!isInstallationPhase())) {
// Prepare content
$content = array(
- 'message' => trim($message),
- 'backtrace' => trim(debug_get_mailable_backtrace())
+ 'message' => trim($message),
+ 'backtrace' => trim(debug_get_mailable_backtrace())
);
// Send email to webmaster