From ad16488643017f293dda6b226024751d15cb4426 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 18 May 2009 06:30:32 +0000 Subject: Turn on IN_PRODUCTION mode now across the board. Create our own error page where we'll show whatever information is useful. Get rid of the IN_PRODUCTION hack in MY_View.php that we no longer need. --- core/libraries/MY_View.php | 7 +-- core/views/kohana_error_page.php | 118 +++++++++++++++++++++++++++++++++++++++ index.php | 2 +- 3 files changed, 120 insertions(+), 7 deletions(-) create mode 100644 core/views/kohana_error_page.php diff --git a/core/libraries/MY_View.php b/core/libraries/MY_View.php index 15f4d6a4..836d1087 100644 --- a/core/libraries/MY_View.php +++ b/core/libraries/MY_View.php @@ -27,7 +27,7 @@ class View extends View_Core { parent::__construct($name, $data, $type); $this->set_global("csrf", access::csrf_token()); } - + /** * Override View_Core::render so that we trap errors stemming from bad PHP includes and show a * visible stack trace to help developers. @@ -38,11 +38,6 @@ class View extends View_Core { try { return parent::render($print, $renderer); } catch (Exception $e) { - if (!IN_PRODUCTION) { - print $e->getTraceAsString(); - return $e->getMessage(); - } - Kohana::Log('error', $e->getTraceAsString()); Kohana::Log('debug', $e->getMessage()); return ""; diff --git a/core/views/kohana_error_page.php b/core/views/kohana_error_page.php new file mode 100644 index 00000000..83ad5abb --- /dev/null +++ b/core/views/kohana_error_page.php @@ -0,0 +1,118 @@ + + + + + + + <?= t("Something went wrong!") ?> + + + + admin ?> +
+

+ +

+

+ +

+ +

+ +

+ +
+ +
+

+ +

+ + + + + + + diff --git a/index.php b/index.php index afd0b104..f4472b72 100644 --- a/index.php +++ b/index.php @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ // Set this to true to disable demo/debugging controllers -define('IN_PRODUCTION', false); +define('IN_PRODUCTION', true); // Gallery requires PHP 5.2+ version_compare(PHP_VERSION, '5.2', '<') and exit('Gallery requires PHP 5.2 or newer.'); -- cgit v1.2.3