|
@@ 84-94 (lines=11) @@
|
| 81 |
|
$container['notFoundHandler'] = function (Container $container) { |
| 82 |
|
return [$container[ErrorController::class], 'notFound']; |
| 83 |
|
}; |
| 84 |
|
$container['errorHandler'] = function (Container $container) { |
| 85 |
|
// Show pretty error page on production and Slim debug info on development. |
| 86 |
|
$next = $container['config']['debug'] ? |
| 87 |
|
new Error($container['config']['debug']) : |
| 88 |
|
[$container[ErrorController::class], 'error']; |
| 89 |
|
|
| 90 |
|
return new Slim\Handler\LoggingErrorHandler( |
| 91 |
|
$container->get('logger'), |
| 92 |
|
$next |
| 93 |
|
); |
| 94 |
|
}; |
| 95 |
|
$container['phpErrorHandler'] = function (Container $container) { |
| 96 |
|
// Show pretty error page on production and Slim debug info on development. |
| 97 |
|
$next = $container['config']['debug'] ? |
|
@@ 95-105 (lines=11) @@
|
| 92 |
|
$next |
| 93 |
|
); |
| 94 |
|
}; |
| 95 |
|
$container['phpErrorHandler'] = function (Container $container) { |
| 96 |
|
// Show pretty error page on production and Slim debug info on development. |
| 97 |
|
$next = $container['config']['debug'] ? |
| 98 |
|
new PhpError($container['config']['debug']) : |
| 99 |
|
[$container[ErrorController::class], 'error']; |
| 100 |
|
|
| 101 |
|
return new Slim\Handler\LoggingErrorHandler( |
| 102 |
|
$container->get('logger'), |
| 103 |
|
$next |
| 104 |
|
); |
| 105 |
|
}; |
| 106 |
|
$container['translator'] = function (Container $container) { |
| 107 |
|
$translator = new Translator($container['config']['locale']); |
| 108 |
|
$translator->setFallbackLocales(['en']); |