From 150fa6a3ac91059456fabf158981f998a6403d33 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 17 Jun 2011 15:03:20 -0700 Subject: [PATCH] Lazy-load error class inside of error handlers. Speed boost! --- public/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/index.php b/public/index.php index 915acaa6..8e6a9e70 100644 --- a/public/index.php +++ b/public/index.php @@ -31,7 +31,6 @@ // Load the configuration, error, and string classes. // -------------------------------------------------------------- require SYS_PATH.'config'.EXT; -require SYS_PATH.'error'.EXT; require SYS_PATH.'str'.EXT; // -------------------------------------------------------------- @@ -54,11 +53,13 @@ // -------------------------------------------------------------- set_exception_handler(function($e) { + require_once SYS_PATH.'error'.EXT; System\Error::handle($e); }); set_error_handler(function($number, $error, $file, $line) { + require_once SYS_PATH.'error'.EXT; System\Error::handle(new ErrorException($error, 0, $number, $file, $line)); }); @@ -66,6 +67,7 @@ { if ( ! is_null($error = error_get_last())) { + require_once SYS_PATH.'error'.EXT; System\Error::handle(new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line'])); } });