2016-07-19 19:01:39 +03:00
|
|
|
<?php
|
2017-10-12 11:13:20 +03:00
|
|
|
declare(strict_types=1);
|
2017-07-22 14:48:30 +03:00
|
|
|
|
|
|
|
use Doctrine\Common\Cache\Cache;
|
|
|
|
use Shlinkio\Shlink\Common\Service\PreviewGenerator;
|
2016-08-09 11:24:42 +03:00
|
|
|
use Shlinkio\Shlink\Core\Action;
|
2016-08-09 14:41:30 +03:00
|
|
|
use Shlinkio\Shlink\Core\Middleware;
|
2016-08-16 00:40:49 +03:00
|
|
|
use Shlinkio\Shlink\Core\Options;
|
2018-05-07 11:58:49 +03:00
|
|
|
use Shlinkio\Shlink\Core\Response\NotFoundHandler;
|
2016-07-19 19:01:39 +03:00
|
|
|
use Shlinkio\Shlink\Core\Service;
|
2017-07-22 14:48:30 +03:00
|
|
|
use Zend\Expressive\Router\RouterInterface;
|
2017-10-13 12:55:14 +03:00
|
|
|
use Zend\Expressive\Template\TemplateRendererInterface;
|
2017-07-22 14:48:30 +03:00
|
|
|
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
2016-07-19 19:01:39 +03:00
|
|
|
|
|
|
|
return [
|
|
|
|
|
2016-07-31 17:30:05 +03:00
|
|
|
'dependencies' => [
|
2016-07-19 19:01:39 +03:00
|
|
|
'factories' => [
|
2018-11-03 13:37:43 +03:00
|
|
|
Options\AppOptions::class => ConfigAbstractFactory::class,
|
|
|
|
Options\DeleteShortUrlsOptions::class => ConfigAbstractFactory::class,
|
|
|
|
Options\NotFoundShortUrlOptions::class => ConfigAbstractFactory::class,
|
2018-05-07 11:58:49 +03:00
|
|
|
NotFoundHandler::class => ConfigAbstractFactory::class,
|
2016-08-07 15:44:33 +03:00
|
|
|
|
2016-07-19 19:01:39 +03:00
|
|
|
// Services
|
2017-07-22 14:48:30 +03: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 13:56:17 +03:00
|
|
|
Service\ShortUrl\DeleteShortUrlService::class => ConfigAbstractFactory::class,
|
2016-07-19 19:01:39 +03:00
|
|
|
|
|
|
|
// Middleware
|
2017-07-22 14:48:30 +03:00
|
|
|
Action\RedirectAction::class => ConfigAbstractFactory::class,
|
2018-03-26 21:13:03 +03:00
|
|
|
Action\PixelAction::class => ConfigAbstractFactory::class,
|
2017-07-22 14:48:30 +03:00
|
|
|
Action\QrCodeAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\PreviewAction::class => ConfigAbstractFactory::class,
|
|
|
|
Middleware\QrCodeCacheMiddleware::class => ConfigAbstractFactory::class,
|
2016-07-19 19:01:39 +03:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
2017-07-22 14:48:30 +03:00
|
|
|
ConfigAbstractFactory::class => [
|
2018-05-07 11:58:49 +03:00
|
|
|
NotFoundHandler::class => [TemplateRendererInterface::class],
|
2017-10-13 12:55:14 +03:00
|
|
|
|
2018-11-03 13:37:43 +03:00
|
|
|
Options\AppOptions::class => ['config.app_options'],
|
|
|
|
Options\DeleteShortUrlsOptions::class => ['config.delete_short_urls'],
|
|
|
|
Options\NotFoundShortUrlOptions::class => ['config.url_shortener.not_found_short_url'],
|
|
|
|
|
2017-07-22 14:48:30 +03:00
|
|
|
// Services
|
2017-10-23 14:28:09 +03:00
|
|
|
Service\UrlShortener::class => [
|
|
|
|
'httpClient',
|
|
|
|
'em',
|
|
|
|
'config.url_shortener.validate_url',
|
|
|
|
'config.url_shortener.shortcode_chars',
|
2016-07-19 19:01:39 +03:00
|
|
|
],
|
2017-07-22 14:48:30 +03:00
|
|
|
Service\VisitsTracker::class => ['em'],
|
|
|
|
Service\ShortUrlService::class => ['em'],
|
|
|
|
Service\VisitService::class => ['em'],
|
|
|
|
Service\Tag\TagService::class => ['em'],
|
2018-09-15 13:56:17 +03:00
|
|
|
Service\ShortUrl\DeleteShortUrlService::class => ['em', Options\DeleteShortUrlsOptions::class],
|
2017-07-22 14:48:30 +03:00
|
|
|
|
|
|
|
// Middleware
|
2018-01-14 11:24:33 +03:00
|
|
|
Action\RedirectAction::class => [
|
|
|
|
Service\UrlShortener::class,
|
|
|
|
Service\VisitsTracker::class,
|
|
|
|
Options\AppOptions::class,
|
2018-11-03 14:10:02 +03:00
|
|
|
Options\NotFoundShortUrlOptions::class,
|
2018-05-07 11:58:49 +03:00
|
|
|
'Logger_Shlink',
|
2018-01-14 11:24:33 +03:00
|
|
|
],
|
2018-03-26 21:13:03 +03:00
|
|
|
Action\PixelAction::class => [
|
|
|
|
Service\UrlShortener::class,
|
|
|
|
Service\VisitsTracker::class,
|
|
|
|
Options\AppOptions::class,
|
2018-05-07 11:58:49 +03:00
|
|
|
'Logger_Shlink',
|
2018-03-26 21:13:03 +03:00
|
|
|
],
|
2017-07-22 14:48:30 +03:00
|
|
|
Action\QrCodeAction::class => [RouterInterface::class, Service\UrlShortener::class, 'Logger_Shlink'],
|
2018-05-07 11:58:49 +03:00
|
|
|
Action\PreviewAction::class => [PreviewGenerator::class, Service\UrlShortener::class, 'Logger_Shlink'],
|
2017-07-22 14:48:30 +03:00
|
|
|
Middleware\QrCodeCacheMiddleware::class => [Cache::class],
|
|
|
|
],
|
|
|
|
|
2016-07-19 19:01:39 +03:00
|
|
|
];
|