sharillibe/ILLI — pull request #22 by icro (2013-03-23 16:37:49+00:00)
Title: fatal error trapping

CLASS Trap EXTENDS \ILLI\Core\Std\Throwable
{
CONST TRAP	= TRUE;
CONST SHUTDOWN	= TRUE;

public static function run()
{
static::$__handle['shutdown'] = function()
{
print Log::html();
};

parent::run();
}
}

...

if(Trap::isRunning())
Trap::stop();

Trap::config(
[
'code' => E_ALL ^ E_STRICT,
'fire' => function($Exception = NULL)
{
Log::add($Exception['Exception']->toTrack()->asText());
}
]);

Trap::run();