engelsystem/config/app.php

88 lines
3.4 KiB
PHP
Raw Normal View History

<?php
declare(strict_types=1);
// Application config
return [
// Service providers
2018-08-12 00:08:52 +02:00
'providers' => [
// Application bootstrap
2017-10-31 13:40:13 +01:00
\Engelsystem\Logger\LoggerServiceProvider::class,
\Engelsystem\Exceptions\ExceptionsServiceProvider::class,
\Engelsystem\Config\ConfigServiceProvider::class,
\Engelsystem\Helpers\ConfigureEnvironmentServiceProvider::class,
2020-12-20 14:52:29 +01:00
\Engelsystem\Events\EventsServiceProvider::class,
// Request handling
\Engelsystem\Http\UrlGeneratorServiceProvider::class,
2017-10-31 13:40:13 +01:00
\Engelsystem\Renderer\RendererServiceProvider::class,
\Engelsystem\Database\DatabaseServiceProvider::class,
\Engelsystem\Http\RequestServiceProvider::class,
\Engelsystem\Http\SessionServiceProvider::class,
\Engelsystem\Helpers\Translation\TranslationServiceProvider::class,
\Engelsystem\Http\ResponseServiceProvider::class,
\Engelsystem\Http\Psr7ServiceProvider::class,
\Engelsystem\Helpers\AuthenticatorServiceProvider::class,
\Engelsystem\Helpers\AssetsServiceProvider::class,
\Engelsystem\Renderer\TwigServiceProvider::class,
\Engelsystem\Middleware\RouteDispatcherServiceProvider::class,
\Engelsystem\Middleware\RequestHandlerServiceProvider::class,
2019-07-09 21:43:18 +02:00
\Engelsystem\Http\Validation\ValidationServiceProvider::class,
\Engelsystem\Http\RedirectServiceProvider::class,
// Additional services
\Engelsystem\Helpers\VersionServiceProvider::class,
\Engelsystem\Mail\MailerServiceProvider::class,
\Engelsystem\Http\HttpClientServiceProvider::class,
\Engelsystem\Helpers\DumpServerServiceProvider::class,
\Engelsystem\Helpers\UuidServiceProvider::class,
\Engelsystem\Controllers\Api\UsesAuthServiceProvider::class,
],
2018-08-12 00:08:52 +02:00
// Application middleware
'middleware' => [
// Basic initialization
2018-08-12 00:08:52 +02:00
\Engelsystem\Middleware\SendResponseHandler::class,
\Engelsystem\Middleware\ExceptionHandler::class,
// Changes of request/response parameters
\Engelsystem\Middleware\SetLocale::class,
2023-04-30 12:29:32 +02:00
\Engelsystem\Middleware\ETagHandler::class,
2018-10-27 12:11:37 +02:00
\Engelsystem\Middleware\AddHeaders::class,
\Engelsystem\Middleware\TrimInput::class,
// The application code
2018-08-29 13:58:50 +02:00
\Engelsystem\Middleware\ErrorHandler::class,
\Engelsystem\Middleware\ApiRouteHandler::class,
2018-09-03 16:33:13 +02:00
\Engelsystem\Middleware\VerifyCsrfToken::class,
\Engelsystem\Middleware\RouteDispatcher::class,
\Engelsystem\Middleware\SessionHandler::class,
// Handle request
\Engelsystem\Middleware\RequestHandler::class,
2018-08-12 00:08:52 +02:00
],
2020-12-20 14:52:29 +01:00
// Event handlers
'event-handlers' => [
// 'event' => [
// a list of
// 'Class@method' or 'Class' (which uses @handle),
// ['Class', 'method'],
// callable like [$instance, 'method'] or 'function'
2020-12-20 14:52:29 +01:00
// or $function
// ]
'message.created' => \Engelsystem\Events\Listener\Messages::class . '@created',
2020-12-28 16:04:05 +01:00
'news.created' => \Engelsystem\Events\Listener\News::class . '@created',
2021-11-23 11:59:53 +01:00
'oauth2.login' => \Engelsystem\Events\Listener\OAuth2::class . '@login',
'shift.entry.deleting' => [
\Engelsystem\Events\Listener\Shift::class . '@deletedEntryCreateWorklog',
\Engelsystem\Events\Listener\Shift::class . '@deletedEntrySendEmail',
],
2020-12-20 14:52:29 +01:00
],
];