From 71bbb03bd9d339d6228701ff71533ca854ecdc53 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Thu, 17 Mar 2016 20:33:32 +0100 Subject: [PATCH] Change exception to die() in order to always show a message when these fatal errors are found As proposed by @mahagr --- index.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index 51d9f55d8..d031fb0f7 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,6 @@ PHP %s to run.', $ver, $req)); + die(sprintf('You are running PHP %s, but Grav needs at least PHP %s to run.', $ver, $req)); } // Set timezone to default, falls back to system if php.ini not set date_default_timezone_set(@date_default_timezone_get()); // Set internal encoding if mbstring loaded -if (!extension_loaded('mbstring')) { - throw new \RuntimeException("'mbstring' extension is not loaded. This is required for Grav to run correctly"); +if (extension_loaded('mbstring')) { + die("'mbstring' extension is not loaded. This is required for Grav to run correctly"); } mb_internal_encoding('UTF-8'); @@ -40,4 +39,3 @@ try { $grav->fireEvent('onFatalException'); throw $e; } -