D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
psa
/
admin
/
plib
/
modules
/
monitoring
/
vendor
/
mezzio
/
mezzio
/
src
/
Filename :
ConfigProvider.php
back
Copy
<?php declare (strict_types=1); namespace PleskMonitoring\Mezzio; use PleskMonitoring\Laminas\HttpHandlerRunner\Emitter\EmitterInterface; use PleskMonitoring\Laminas\HttpHandlerRunner\RequestHandlerRunner; use PleskMonitoring\Laminas\HttpHandlerRunner\RequestHandlerRunnerInterface; use PleskMonitoring\Laminas\ServiceManager\ConfigInterface; use PleskMonitoring\Laminas\Stratigility\Middleware\ErrorHandler; use PleskMonitoring\Psr\Http\Message\ResponseInterface; use PleskMonitoring\Psr\Http\Message\ServerRequestInterface; use PleskMonitoring\Psr\Http\Message\StreamInterface; /** * Provide initial configuration for mezzio. * * This class provides initial _production_ configuration for mezzio. * * @psalm-import-type ServiceManagerConfigurationType from ConfigInterface */ class ConfigProvider { public const DIACTOROS_CONFIG_KEY = 'laminas-diactoros'; public const DIACTOROS_SERVER_REQUEST_FILTER_CONFIG_KEY = 'server-request-filter'; public const DIACTOROS_X_FORWARDED_FILTER_CONFIG_KEY = 'x-forwarded-headers'; public const DIACTOROS_TRUSTED_PROXIES_CONFIG_KEY = 'trusted-proxies'; public const DIACTOROS_TRUSTED_HEADERS_CONFIG_KEY = 'trusted-headers'; /** @return array{dependencies: ServiceManagerConfigurationType} */ public function __invoke() : array { return ['dependencies' => $this->getDependencies()]; } /** @return ServiceManagerConfigurationType */ public function getDependencies() : array { // phpcs:disable Generic.Files.LineLength.TooLong return ['aliases' => [ DEFAULT_DELEGATE => Handler\NotFoundHandler::class, DISPATCH_MIDDLEWARE => Router\Middleware\DispatchMiddleware::class, IMPLICIT_HEAD_MIDDLEWARE => Router\Middleware\ImplicitHeadMiddleware::class, IMPLICIT_OPTIONS_MIDDLEWARE => Router\Middleware\ImplicitOptionsMiddleware::class, NOT_FOUND_MIDDLEWARE => Handler\NotFoundHandler::class, ROUTE_MIDDLEWARE => Router\Middleware\RouteMiddleware::class, RequestHandlerRunnerInterface::class => RequestHandlerRunner::class, MiddlewareFactoryInterface::class => MiddlewareFactory::class, // Legacy Zend Framework aliases 'PleskMonitoring\\Zend\\Expressive\\Application' => Application::class, 'PleskMonitoring\\Zend\\Expressive\\ApplicationPipeline' => 'PleskMonitoring\\Mezzio\\ApplicationPipeline', 'PleskMonitoring\\Zend\\HttpHandlerRunner\\Emitter\\EmitterInterface' => EmitterInterface::class, 'PleskMonitoring\\Zend\\Stratigility\\Middleware\\ErrorHandler' => ErrorHandler::class, 'PleskMonitoring\\Zend\\Expressive\\Handler\\NotFoundHandler' => Handler\NotFoundHandler::class, 'PleskMonitoring\\Zend\\Expressive\\MiddlewareContainer' => MiddlewareContainer::class, 'PleskMonitoring\\Zend\\Expressive\\MiddlewareFactory' => MiddlewareFactory::class, 'PleskMonitoring\\Zend\\Expressive\\Middleware\\ErrorResponseGenerator' => Middleware\ErrorResponseGenerator::class, 'PleskMonitoring\\Zend\\HttpHandlerRunner\\RequestHandlerRunner' => RequestHandlerRunner::class, 'PleskMonitoring\\Zend\\Expressive\\Response\\ServerRequestErrorResponseGenerator' => Response\ServerRequestErrorResponseGenerator::class, ], 'factories' => [ Application::class => Container\ApplicationFactory::class, 'PleskMonitoring\\Mezzio\\ApplicationPipeline' => Container\ApplicationPipelineFactory::class, EmitterInterface::class => Container\EmitterFactory::class, ErrorHandler::class => Container\ErrorHandlerFactory::class, Handler\NotFoundHandler::class => Container\NotFoundHandlerFactory::class, MiddlewareContainer::class => Container\MiddlewareContainerFactory::class, MiddlewareFactory::class => Container\MiddlewareFactoryFactory::class, // Change the following in development to the WhoopsErrorResponseGeneratorFactory: Middleware\ErrorResponseGenerator::class => Container\ErrorResponseGeneratorFactory::class, RequestHandlerRunner::class => Container\RequestHandlerRunnerFactory::class, ResponseInterface::class => Container\ResponseFactoryFactory::class, Response\ServerRequestErrorResponseGenerator::class => Container\ServerRequestErrorResponseGeneratorFactory::class, ServerRequestInterface::class => Container\ServerRequestFactoryFactory::class, StreamInterface::class => Container\StreamFactoryFactory::class, ]]; // phpcs:enable Generic.Files.LineLength.TooLong } }