2016-07-19 11:01:39 -05:00
|
|
|
<?php
|
2019-10-05 10:26:10 -05:00
|
|
|
|
2017-10-12 03:13:20 -05:00
|
|
|
declare(strict_types=1);
|
2017-07-22 06:48:30 -05:00
|
|
|
|
2018-12-01 14:38:29 -06:00
|
|
|
namespace Shlinkio\Shlink\Core;
|
|
|
|
|
2017-07-22 06:48:30 -05:00
|
|
|
use Doctrine\Common\Cache\Cache;
|
2019-07-13 05:04:21 -05:00
|
|
|
use Psr\EventDispatcher\EventDispatcherInterface;
|
2018-05-07 03:58:49 -05:00
|
|
|
use Shlinkio\Shlink\Core\Response\NotFoundHandler;
|
2019-08-11 12:38:46 -05:00
|
|
|
use Shlinkio\Shlink\PreviewGenerator\Service\PreviewGenerator;
|
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' => [
|
2018-12-01 14:38:29 -06:00
|
|
|
NotFoundHandler::class => ConfigAbstractFactory::class,
|
|
|
|
|
2018-11-03 05:37:43 -05:00
|
|
|
Options\AppOptions::class => ConfigAbstractFactory::class,
|
|
|
|
Options\DeleteShortUrlsOptions::class => ConfigAbstractFactory::class,
|
|
|
|
Options\NotFoundShortUrlOptions::class => ConfigAbstractFactory::class,
|
2018-12-01 14:38:29 -06:00
|
|
|
Options\UrlShortenerOptions::class => ConfigAbstractFactory::class,
|
2016-08-07 07:44:33 -05:00
|
|
|
|
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,
|
2018-09-15 05:56:17 -05:00
|
|
|
Service\ShortUrl\DeleteShortUrlService::class => ConfigAbstractFactory::class,
|
2016-07-19 11:01:39 -05:00
|
|
|
|
2017-07-22 06:48:30 -05:00
|
|
|
Action\RedirectAction::class => ConfigAbstractFactory::class,
|
2018-03-26 13:13:03 -05:00
|
|
|
Action\PixelAction::class => ConfigAbstractFactory::class,
|
2017-07-22 06:48:30 -05:00
|
|
|
Action\QrCodeAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\PreviewAction::class => ConfigAbstractFactory::class,
|
2018-12-01 14:38:29 -06:00
|
|
|
|
2017-07-22 06:48:30 -05:00
|
|
|
Middleware\QrCodeCacheMiddleware::class => ConfigAbstractFactory::class,
|
2016-07-19 11:01:39 -05:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
2017-07-22 06:48:30 -05:00
|
|
|
ConfigAbstractFactory::class => [
|
2018-05-07 03:58:49 -05:00
|
|
|
NotFoundHandler::class => [TemplateRendererInterface::class],
|
2017-10-13 04:55:14 -05:00
|
|
|
|
2018-11-03 05:37:43 -05:00
|
|
|
Options\AppOptions::class => ['config.app_options'],
|
|
|
|
Options\DeleteShortUrlsOptions::class => ['config.delete_short_urls'],
|
|
|
|
Options\NotFoundShortUrlOptions::class => ['config.url_shortener.not_found_short_url'],
|
2018-12-01 14:38:29 -06:00
|
|
|
Options\UrlShortenerOptions::class => ['config.url_shortener'],
|
2018-11-03 05:37:43 -05:00
|
|
|
|
2019-02-03 01:17:22 -06:00
|
|
|
Service\UrlShortener::class => ['httpClient', 'em', Options\UrlShortenerOptions::class],
|
2019-07-13 05:04:21 -05:00
|
|
|
Service\VisitsTracker::class => ['em', EventDispatcherInterface::class],
|
2017-07-22 06:48:30 -05:00
|
|
|
Service\ShortUrlService::class => ['em'],
|
|
|
|
Service\VisitService::class => ['em'],
|
|
|
|
Service\Tag\TagService::class => ['em'],
|
2018-09-15 05:56:17 -05:00
|
|
|
Service\ShortUrl\DeleteShortUrlService::class => ['em', Options\DeleteShortUrlsOptions::class],
|
2017-07-22 06:48:30 -05:00
|
|
|
|
2018-01-14 02:24:33 -06:00
|
|
|
Action\RedirectAction::class => [
|
|
|
|
Service\UrlShortener::class,
|
|
|
|
Service\VisitsTracker::class,
|
|
|
|
Options\AppOptions::class,
|
2018-11-03 06:10:02 -05:00
|
|
|
Options\NotFoundShortUrlOptions::class,
|
2018-05-07 03:58:49 -05:00
|
|
|
'Logger_Shlink',
|
2018-01-14 02:24:33 -06:00
|
|
|
],
|
2018-03-26 13:13:03 -05:00
|
|
|
Action\PixelAction::class => [
|
|
|
|
Service\UrlShortener::class,
|
|
|
|
Service\VisitsTracker::class,
|
|
|
|
Options\AppOptions::class,
|
2018-05-07 03:58:49 -05:00
|
|
|
'Logger_Shlink',
|
2018-03-26 13:13:03 -05:00
|
|
|
],
|
2017-07-22 06:48:30 -05:00
|
|
|
Action\QrCodeAction::class => [RouterInterface::class, Service\UrlShortener::class, 'Logger_Shlink'],
|
2018-05-07 03:58:49 -05:00
|
|
|
Action\PreviewAction::class => [PreviewGenerator::class, Service\UrlShortener::class, 'Logger_Shlink'],
|
2018-12-01 14:38:29 -06:00
|
|
|
|
2017-07-22 06:48:30 -05:00
|
|
|
Middleware\QrCodeCacheMiddleware::class => [Cache::class],
|
|
|
|
],
|
|
|
|
|
2016-07-19 11:01:39 -05:00
|
|
|
];
|