2016-07-19 11:01:39 -05:00
|
|
|
<?php
|
2017-10-12 03:13:20 -05:00
|
|
|
declare(strict_types=1);
|
2017-07-22 06:48:30 -05:00
|
|
|
|
|
|
|
use Doctrine\Common\Cache\Cache;
|
|
|
|
use Shlinkio\Shlink\Common\Service\PreviewGenerator;
|
2016-08-09 03:24:42 -05:00
|
|
|
use Shlinkio\Shlink\Core\Action;
|
2016-08-09 06:41:30 -05:00
|
|
|
use Shlinkio\Shlink\Core\Middleware;
|
2016-08-15 16:40:49 -05:00
|
|
|
use Shlinkio\Shlink\Core\Options;
|
2017-10-13 04:55:14 -05:00
|
|
|
use Shlinkio\Shlink\Core\Response\NotFoundDelegate;
|
2016-07-19 11:01:39 -05:00
|
|
|
use Shlinkio\Shlink\Core\Service;
|
2017-07-22 06:48:30 -05:00
|
|
|
use Zend\Expressive\Router\RouterInterface;
|
2017-10-13 04:55:14 -05:00
|
|
|
use Zend\Expressive\Template\TemplateRendererInterface;
|
2017-07-22 06:48:30 -05:00
|
|
|
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
2016-07-19 11:01:39 -05:00
|
|
|
|
|
|
|
return [
|
|
|
|
|
2016-07-31 09:30:05 -05:00
|
|
|
'dependencies' => [
|
2016-07-19 11:01:39 -05:00
|
|
|
'factories' => [
|
2016-08-15 16:40:49 -05:00
|
|
|
Options\AppOptions::class => Options\AppOptionsFactory::class,
|
2017-10-13 04:55:14 -05:00
|
|
|
NotFoundDelegate::class => ConfigAbstractFactory::class,
|
2016-08-07 07:44:33 -05:00
|
|
|
|
2016-07-19 11:01:39 -05:00
|
|
|
// Services
|
2017-07-22 06:48:30 -05:00
|
|
|
Service\UrlShortener::class => ConfigAbstractFactory::class,
|
|
|
|
Service\VisitsTracker::class => ConfigAbstractFactory::class,
|
|
|
|
Service\ShortUrlService::class => ConfigAbstractFactory::class,
|
|
|
|
Service\VisitService::class => ConfigAbstractFactory::class,
|
|
|
|
Service\Tag\TagService::class => ConfigAbstractFactory::class,
|
2016-07-19 11:01:39 -05:00
|
|
|
|
|
|
|
// Middleware
|
2017-07-22 06:48:30 -05:00
|
|
|
Action\RedirectAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\QrCodeAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\PreviewAction::class => ConfigAbstractFactory::class,
|
|
|
|
Middleware\QrCodeCacheMiddleware::class => ConfigAbstractFactory::class,
|
2016-07-19 11:01:39 -05:00
|
|
|
],
|
2017-10-13 04:55:14 -05:00
|
|
|
|
|
|
|
'aliases' => [
|
|
|
|
'Zend\Expressive\Delegate\DefaultDelegate' => NotFoundDelegate::class,
|
|
|
|
],
|
2016-07-19 11:01:39 -05:00
|
|
|
],
|
|
|
|
|
2017-07-22 06:48:30 -05:00
|
|
|
ConfigAbstractFactory::class => [
|
2017-10-13 04:55:14 -05:00
|
|
|
NotFoundDelegate::class => [TemplateRendererInterface::class],
|
|
|
|
|
2017-07-22 06:48:30 -05:00
|
|
|
// Services
|
2017-10-23 06:28:09 -05:00
|
|
|
Service\UrlShortener::class => [
|
|
|
|
'httpClient',
|
|
|
|
'em',
|
|
|
|
Cache::class,
|
|
|
|
'config.url_shortener.validate_url',
|
|
|
|
'config.url_shortener.shortcode_chars',
|
2016-07-19 11:01:39 -05:00
|
|
|
],
|
2017-07-22 06:48:30 -05:00
|
|
|
Service\VisitsTracker::class => ['em'],
|
|
|
|
Service\ShortUrlService::class => ['em'],
|
|
|
|
Service\VisitService::class => ['em'],
|
|
|
|
Service\Tag\TagService::class => ['em'],
|
|
|
|
|
|
|
|
// Middleware
|
2018-01-14 02:24:33 -06:00
|
|
|
Action\RedirectAction::class => [
|
|
|
|
Service\UrlShortener::class,
|
|
|
|
Service\VisitsTracker::class,
|
|
|
|
Options\AppOptions::class,
|
|
|
|
],
|
2017-07-22 06:48:30 -05:00
|
|
|
Action\QrCodeAction::class => [RouterInterface::class, Service\UrlShortener::class, 'Logger_Shlink'],
|
|
|
|
Action\PreviewAction::class => [PreviewGenerator::class, Service\UrlShortener::class],
|
|
|
|
Middleware\QrCodeCacheMiddleware::class => [Cache::class],
|
|
|
|
],
|
|
|
|
|
2016-07-19 11:01:39 -05:00
|
|
|
];
|