Fix debug setting exception handler
This commit is contained in:
parent
b32fdef1ec
commit
2e08a63aa7
3 changed files with 5 additions and 4 deletions
|
@ -1 +1 @@
|
||||||
An error has occured
|
Er is helaas iets mis gegaan. Probeer het opnieuw
|
|
@ -27,8 +27,8 @@ class Env {
|
||||||
private static function filter(string $result)
|
private static function filter(string $result)
|
||||||
{
|
{
|
||||||
switch ($result) {
|
switch ($result) {
|
||||||
case filter_var($result, FILTER_VALIDATE_BOOLEAN):
|
case in_array($result, ['true', 'false']):
|
||||||
return (bool) $result;
|
return filter_var($result, FILTER_VALIDATE_BOOLEAN);
|
||||||
break;
|
break;
|
||||||
case filter_var($result, FILTER_VALIDATE_INT):
|
case filter_var($result, FILTER_VALIDATE_INT):
|
||||||
return (int) $result;
|
return (int) $result;
|
||||||
|
|
|
@ -8,6 +8,7 @@ use Whoops\Handler\PlainTextHandler;
|
||||||
use Whoops\Run;
|
use Whoops\Run;
|
||||||
use Whoops\Handler\PrettyPageHandler;
|
use Whoops\Handler\PrettyPageHandler;
|
||||||
use Whoops\Util\Misc;
|
use Whoops\Util\Misc;
|
||||||
|
use function DI\value;
|
||||||
|
|
||||||
class ExceptionHandler {
|
class ExceptionHandler {
|
||||||
|
|
||||||
|
@ -40,7 +41,7 @@ class ExceptionHandler {
|
||||||
{
|
{
|
||||||
self::$handler = new Run();
|
self::$handler = new Run();
|
||||||
|
|
||||||
$debug = true; //TODO: Get from config
|
$debug = env('debug');
|
||||||
|
|
||||||
if($debug === false) {
|
if($debug === false) {
|
||||||
self::$handler->pushHandler(function() {
|
self::$handler->pushHandler(function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue