bastianallgeier/kirbycms — pull request #31 by vis7mac (2012-08-08 09:26:17+00:00)
Title: Added a new helper function: "debug"

With this debug() function you can easily throw an error from a plugin for example. The error will just be echoed when the "debug" config var is set to true.

Usage:
$echoed = debug($msg, $die);

$msg: The message to output

$die:
true for "bad error, die() with the message" (will also be used when debug() is not set, but if debug=false nothing will be echoed, it will just die (like a fatal PHP error),
false for "normal echo output, only if debug enabled (like a notice).

$echoed: Returns if something was echoed, of course only if $die is false ;)