shlink/config/autoload/services.global.php

53 lines
2.1 KiB
PHP
Raw Normal View History

2016-04-10 09:38:07 +02:00
<?php
use Acelaya\UrlShortener\Factory\CacheFactory;
2016-04-17 20:27:24 +02:00
use Acelaya\UrlShortener\Factory\EntityManagerFactory;
use Acelaya\UrlShortener\Middleware;
2016-04-17 20:27:24 +02:00
use Acelaya\UrlShortener\Service\UrlShortener;
use Acelaya\ZsmAnnotatedServices\Factory\V3\AnnotatedFactory;
use Doctrine\Common\Cache\Cache;
2016-04-17 20:27:24 +02:00
use Doctrine\ORM\EntityManager;
2016-04-10 09:38:07 +02:00
use Zend\Expressive\Application;
use Zend\Expressive\Container;
use Zend\Expressive\Helper;
use Zend\Expressive\Router;
use Zend\Expressive\Template;
2016-04-17 20:27:24 +02:00
use Zend\Expressive\Twig;
use Zend\ServiceManager\Factory\InvokableFactory;
2016-04-10 09:38:07 +02:00
return [
'services' => [
'factories' => [
Application::class => Container\ApplicationFactory::class,
// Url helpers
2016-04-10 09:38:07 +02:00
Helper\UrlHelper::class => Helper\UrlHelperFactory::class,
Helper\ServerUrlMiddleware::class => Helper\ServerUrlMiddlewareFactory::class,
Helper\UrlHelperMiddleware::class => Helper\UrlHelperMiddlewareFactory::class,
2016-04-17 20:27:24 +02:00
Helper\ServerUrlHelper::class => InvokableFactory::class,
Router\FastRouteRouter::class => InvokableFactory::class,
2016-04-10 09:38:07 +02:00
// View
'Zend\Expressive\FinalHandler' => Container\TemplatedErrorHandlerFactory::class,
2016-04-17 20:27:24 +02:00
Template\TemplateRendererInterface::class => Twig\TwigRendererFactory::class,
// Services
EntityManager::class => EntityManagerFactory::class,
GuzzleHttp\Client::class => InvokableFactory::class,
UrlShortener::class => AnnotatedFactory::class,
Cache::class => CacheFactory::class,
// Middleware
Middleware\CliRoutable\GenerateShortcodeMiddleware::class => AnnotatedFactory::class,
Middleware\Routable\RedirectMiddleware::class => AnnotatedFactory::class,
2016-04-30 18:14:43 +02:00
Middleware\CliParamsMiddleware::class => Middleware\Factory\CliParamsMiddlewareFactory::class,
2016-04-10 09:38:07 +02:00
],
2016-04-17 20:27:24 +02:00
'aliases' => [
'em' => EntityManager::class,
'httpClient' => GuzzleHttp\Client::class,
Router\RouterInterface::class => Router\FastRouteRouter::class,
2016-04-17 20:27:24 +02:00
]
2016-04-10 09:38:07 +02:00
],
];