From 063cde50c0a0f37962e3b9367b2a0789b8b4bbf7 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sun, 10 Jul 2011 23:08:14 -0500 Subject: [PATCH] removed file context from error messages. --- system/error.php | 32 +------------------------------- system/views/exception.php | 14 -------------- 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/system/error.php b/system/error.php index 6e98cde3..7af64e51 100644 --- a/system/error.php +++ b/system/error.php @@ -51,6 +51,7 @@ public static function handle($e) $file = $e->getFile(); } + // Trim the period off the error message since we will be formatting it oursevles. $message = rtrim($e->getMessage(), '.'); if (Config::get('error.log')) @@ -66,7 +67,6 @@ public static function handle($e) ->bind('file', $file) ->bind('line', $e->getLine()) ->bind('trace', $e->getTraceAsString()) - ->bind('contexts', static::context($file, $e->getLine())); Response::make($view, 500)->send(); } @@ -78,34 +78,4 @@ public static function handle($e) exit(1); } - /** - * Get the file context of an exception. - * - * @param string $path - * @param int $line - * @param int $padding - * @return array - */ - private static function context($path, $line, $padding = 5) - { - if (file_exists($path)) - { - $file = file($path, FILE_IGNORE_NEW_LINES); - - array_unshift($file, ''); - - // Calculate the starting position of the file context. - $start = $line - $padding; - $start = ($start < 0) ? 0 : $start; - - // Calculate the context length. - $length = ($line - $start) + $padding + 1; - $length = (($start + $length) > count($file) - 1) ? null : $length; - - return array_slice($file, $start, $length, true); - } - - return array(); - } - } \ No newline at end of file diff --git a/system/views/exception.php b/system/views/exception.php index 996eecf9..f2606d86 100644 --- a/system/views/exception.php +++ b/system/views/exception.php @@ -60,20 +60,6 @@
- -
-

Context:

- - 0) { ?> - - $context) { ?> -
- - - - Context unavailable. - -
\ No newline at end of file