Fix debug setting exception handler

This commit is contained in:
Maarten 2020-02-13 19:05:48 +01:00
parent b32fdef1ec
commit 2e08a63aa7
3 changed files with 5 additions and 4 deletions

View file

@ -1 +1 @@
An error has occured
Er is helaas iets mis gegaan. Probeer het opnieuw

View file

@ -27,8 +27,8 @@ class Env {
private static function filter(string $result)
{
switch ($result) {
case filter_var($result, FILTER_VALIDATE_BOOLEAN):
return (bool) $result;
case in_array($result, ['true', 'false']):
return filter_var($result, FILTER_VALIDATE_BOOLEAN);
break;
case filter_var($result, FILTER_VALIDATE_INT):
return (int) $result;

View file

@ -8,6 +8,7 @@ use Whoops\Handler\PlainTextHandler;
use Whoops\Run;
use Whoops\Handler\PrettyPageHandler;
use Whoops\Util\Misc;
use function DI\value;
class ExceptionHandler {
@ -40,7 +41,7 @@ class ExceptionHandler {
{
self::$handler = new Run();
$debug = true; //TODO: Get from config
$debug = env('debug');
if($debug === false) {
self::$handler->pushHandler(function() {