From 62856a15ce7a2a92c8e0afcce26a74483dd085b4 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 31 Jan 2012 13:29:38 -0600 Subject: [PATCH] added config option for display_errors. fixed response::error to use dot syntax. --- application/config/error.php | 17 +++++++++++++++++ laravel/laravel.php | 2 +- laravel/response.php | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/application/config/error.php b/application/config/error.php index 87db9665..cebdae8a 100644 --- a/application/config/error.php +++ b/application/config/error.php @@ -66,4 +66,21 @@ Log::exception($exception); }, + /* + |-------------------------------------------------------------------------- + | PHP INI Display Errors Setting + |-------------------------------------------------------------------------- + | + | Here you may specify the display_errors setting of the PHP.ini file. + | Typically you may keep this "Off", as Laravel will cleanly handle + | the display of all errors. + | + | However, if you encounter an infamous white screen of death scenario, + | turning this "On" may help you solve the problem by getting the + | real error message being thrown by the application. + | + */ + + 'display' => 'Off', + ); \ No newline at end of file diff --git a/laravel/laravel.php b/laravel/laravel.php index 31055fc9..5125a0de 100644 --- a/laravel/laravel.php +++ b/laravel/laravel.php @@ -57,7 +57,7 @@ */ error_reporting(-1); -ini_set('display_errors', 'Off'); +ini_set('display_errors', Config::get('error.display')); /** * Even though "Magic Quotes" are deprecated in PHP 5.3, they may diff --git a/laravel/response.php b/laravel/response.php index f11b1eae..11a9a2bf 100644 --- a/laravel/response.php +++ b/laravel/response.php @@ -157,7 +157,7 @@ public static function view($view, $data = array()) */ public static function error($code, $data = array()) { - return new static(View::make('error/'.$code, $data), $code); + return new static(View::make('error.'.$code, $data), $code); } /**