refactor
- add documentation for EF API calling implementation - greater adherence to standards - better DI logic
This commit is contained in:
@@ -8,6 +8,22 @@ use Core\RateLimiter\RateLimiterInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
$logger = $container->make(LoggerInterface::class);
|
||||
|
||||
set_exception_handler(function (\Throwable $e) use ($logger) {
|
||||
$logger->error('Uncaught Exception: ' . $e->getMessage(), [
|
||||
'exception' => $e,
|
||||
'trace' => $e->getTraceAsString()
|
||||
]);
|
||||
|
||||
http_response_code(500);
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode([
|
||||
'error' => 'Internal Server Error',
|
||||
'message' => 'An unexpected error occurred.'
|
||||
]);
|
||||
exit;
|
||||
});
|
||||
|
||||
$limiter = $container->make(RateLimiterInterface::class);
|
||||
|
||||
$router = new Router($container); // vedi nota: router può ricevere container
|
||||
|
||||
Reference in New Issue
Block a user