* @license PHP License * @package WB * @subpackage base */ WBClass::load('WBEvent_Handler'); /** * Event_Handler_Debug * * Prints stuff on debu * * @version 0.1.1 * @package WB * @subpackage base */ class WBEvent_Handler_Debug extends WBEvent_Handler { /** * Handler Config * * @var array */ protected $config = array( 'title' => 'Debug', 'titleformat' => "

%s

\n", 'dataformat' => "
%s
\n" ); /** * Process event * * @see isRecoverable() * @param WBEvent $e * @return bool true to continue, false to stop processing * @throws Exception in case of error */ public function process(WBEvent $e) { $debug = WBParam::get('wb/debug', 0); if (5 > $debug) { return true; } printf($this->config['titleformat'], $this->config['title']); if (empty($this->config['dataformat'])) { return true; } printf($this->config['dataformat'], print_r($e->get(), true)); return true; } }