*
* @param $varMatches An array full of variable/value pairs.
* @return void
+ * @todo Unfinished work or don't die here.
*/
private function assignAllVariables (array $varMatches) {
// Search for all variables
$this->assignVariable($var, $varMatches[3][$key]);
} elseif (!empty($varMatches[2][$key])) {
// Non-string found so we need some deeper analysis...
- /* @TODO Unfinished work or don't die here. */
die("Deeper analysis not yet implemented!");
}
* Compile all variables by inserting their respective values
*
* @return void
+ * @todo Make this code some nicer...
*/
public final function compileVariables () {
// Initialize the $content array
);
// This loop does remove the backslashes (\) in PHP parameters
- /* @TODO Make this some nicer... */
while (strpos($eval, "<?") !== false) {
// Get left part before "<?"
$evalLeft = substr($eval, 0, strpos($eval, "<?"));
$eval = str_replace(
"<%php", "\";",
str_replace(
- "%>", "\$result .= \"", $eval
+ "%>", "\n\$result .= \"", $eval
)
);
// Did something change?
if (strlen($eval) != $eval) {
// Run the constructed command. This will "compile" all variables in
- eval($eval);
+ @eval($eval);
+ } // END - if
+
+ // Goes something wrong?
+ if (!isset($result)) {
+ // Output eval command
+ $this->debugOutput(sprintf("Failed eval() code: <pre>%s</pre>", $this->markupCode($eval, true)), true);
+
+ // Output backtrace here
+ $this->debugBacktrace();
} // END - if
// Set raw template data
$this->getTemplateType()
);
- if ((is_object($this->getDebugInstance())) && (method_exists($this->getDebugInstance(), 'output'))) {
- // Use debug output handler
- $this->getDebugInstance()->output($msg);
- die();
- } else {
- // Put directly out
- // DO NOT REWRITE THIS TO app_die() !!!
- die($msg);
- }
+ // Write the problem to the world...
+ $this->debugOutput($msg);
break;
}
}