2016-07-19 19:01:39 +03:00
|
|
|
<?php
|
2019-10-05 18:26:10 +03:00
|
|
|
|
2017-10-12 11:13:20 +03:00
|
|
|
declare(strict_types=1);
|
2017-07-22 14:48:30 +03:00
|
|
|
|
2018-12-01 23:38:29 +03:00
|
|
|
namespace Shlinkio\Shlink\Core;
|
|
|
|
|
2020-01-01 23:11:53 +03:00
|
|
|
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
|
|
|
use Mezzio\Template\TemplateRendererInterface;
|
2019-07-13 13:04:21 +03:00
|
|
|
use Psr\EventDispatcher\EventDispatcherInterface;
|
2020-03-22 19:05:59 +03:00
|
|
|
use Shlinkio\Shlink\Core\Domain\Resolver;
|
2019-11-23 12:25:12 +03:00
|
|
|
use Shlinkio\Shlink\Core\ErrorHandler;
|
2019-11-02 20:33:26 +03:00
|
|
|
use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions;
|
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' => [
|
2019-11-23 12:25:12 +03:00
|
|
|
ErrorHandler\NotFoundRedirectHandler::class => ConfigAbstractFactory::class,
|
|
|
|
ErrorHandler\NotFoundTemplateHandler::class => ConfigAbstractFactory::class,
|
2018-12-01 23:38:29 +03:00
|
|
|
|
2018-11-03 13:37:43 +03:00
|
|
|
Options\AppOptions::class => ConfigAbstractFactory::class,
|
|
|
|
Options\DeleteShortUrlsOptions::class => ConfigAbstractFactory::class,
|
2019-11-02 19:23:21 +03:00
|
|
|
Options\NotFoundRedirectOptions::class => ConfigAbstractFactory::class,
|
2018-12-01 23:38:29 +03:00
|
|
|
Options\UrlShortenerOptions::class => ConfigAbstractFactory::class,
|
2016-08-07 15:44:33 +03:00
|
|
|
|
2017-07-22 14:48:30 +03:00
|
|
|
Service\UrlShortener::class => ConfigAbstractFactory::class,
|
|
|
|
Service\VisitsTracker::class => ConfigAbstractFactory::class,
|
|
|
|
Service\ShortUrlService::class => ConfigAbstractFactory::class,
|
2020-03-27 00:17:13 +03:00
|
|
|
Visit\VisitLocator::class => ConfigAbstractFactory::class,
|
2020-05-01 12:40:02 +03:00
|
|
|
Visit\VisitsStatsHelper::class => ConfigAbstractFactory::class,
|
2020-05-08 11:15:33 +03:00
|
|
|
Tag\TagService::class => ConfigAbstractFactory::class,
|
2018-09-15 13:56:17 +03:00
|
|
|
Service\ShortUrl\DeleteShortUrlService::class => ConfigAbstractFactory::class,
|
2020-01-26 21:21:51 +03:00
|
|
|
Service\ShortUrl\ShortUrlResolver::class => ConfigAbstractFactory::class,
|
2016-07-19 19:01:39 +03:00
|
|
|
|
2019-11-16 12:06:55 +03:00
|
|
|
Util\UrlValidator::class => ConfigAbstractFactory::class,
|
|
|
|
|
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,
|
2018-12-01 23:38:29 +03:00
|
|
|
|
2020-03-22 19:05:59 +03:00
|
|
|
Resolver\PersistenceDomainResolver::class => ConfigAbstractFactory::class,
|
2020-04-12 18:05:59 +03:00
|
|
|
|
|
|
|
Mercure\MercureUpdatesGenerator::class => ConfigAbstractFactory::class,
|
2016-07-19 19:01:39 +03:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
2017-07-22 14:48:30 +03:00
|
|
|
ConfigAbstractFactory::class => [
|
2019-11-23 12:25:12 +03:00
|
|
|
ErrorHandler\NotFoundRedirectHandler::class => [NotFoundRedirectOptions::class, 'config.router.base_path'],
|
|
|
|
ErrorHandler\NotFoundTemplateHandler::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'],
|
2019-11-02 19:23:21 +03:00
|
|
|
Options\NotFoundRedirectOptions::class => ['config.not_found_redirects'],
|
2018-12-01 23:38:29 +03:00
|
|
|
Options\UrlShortenerOptions::class => ['config.url_shortener'],
|
2018-11-03 13:37:43 +03:00
|
|
|
|
2020-03-22 19:05:59 +03:00
|
|
|
Service\UrlShortener::class => [Util\UrlValidator::class, 'em', Resolver\PersistenceDomainResolver::class],
|
2020-05-08 14:10:58 +03:00
|
|
|
Service\VisitsTracker::class => [
|
|
|
|
'em',
|
|
|
|
EventDispatcherInterface::class,
|
2020-05-08 16:43:09 +03:00
|
|
|
'config.url_shortener.anonymize_remote_addr',
|
2020-05-08 14:10:58 +03:00
|
|
|
],
|
2020-03-22 19:22:52 +03:00
|
|
|
Service\ShortUrlService::class => ['em', Service\ShortUrl\ShortUrlResolver::class, Util\UrlValidator::class],
|
2020-03-27 00:17:13 +03:00
|
|
|
Visit\VisitLocator::class => ['em'],
|
2020-05-01 12:40:02 +03:00
|
|
|
Visit\VisitsStatsHelper::class => ['em'],
|
2020-05-08 11:15:33 +03:00
|
|
|
Tag\TagService::class => ['em'],
|
2020-02-02 00:54:02 +03:00
|
|
|
Service\ShortUrl\DeleteShortUrlService::class => [
|
|
|
|
'em',
|
|
|
|
Options\DeleteShortUrlsOptions::class,
|
|
|
|
Service\ShortUrl\ShortUrlResolver::class,
|
|
|
|
],
|
2020-01-26 21:21:51 +03:00
|
|
|
Service\ShortUrl\ShortUrlResolver::class => ['em'],
|
2017-07-22 14:48:30 +03:00
|
|
|
|
2020-03-22 18:58:28 +03:00
|
|
|
Util\UrlValidator::class => ['httpClient', Options\UrlShortenerOptions::class],
|
2019-11-16 12:06:55 +03:00
|
|
|
|
2018-01-14 11:24:33 +03:00
|
|
|
Action\RedirectAction::class => [
|
2020-01-26 21:21:51 +03:00
|
|
|
Service\ShortUrl\ShortUrlResolver::class,
|
2018-01-14 11:24:33 +03:00
|
|
|
Service\VisitsTracker::class,
|
|
|
|
Options\AppOptions::class,
|
2020-06-17 20:01:56 +03:00
|
|
|
Options\UrlShortenerOptions::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 => [
|
2020-01-26 21:21:51 +03:00
|
|
|
Service\ShortUrl\ShortUrlResolver::class,
|
2018-03-26 21:13:03 +03:00
|
|
|
Service\VisitsTracker::class,
|
|
|
|
Options\AppOptions::class,
|
2018-05-07 11:58:49 +03:00
|
|
|
'Logger_Shlink',
|
2018-03-26 21:13:03 +03:00
|
|
|
],
|
2020-01-26 21:21:51 +03:00
|
|
|
Action\QrCodeAction::class => [
|
|
|
|
Service\ShortUrl\ShortUrlResolver::class,
|
2020-04-09 13:31:03 +03:00
|
|
|
'config.url_shortener.domain',
|
2020-01-26 21:21:51 +03:00
|
|
|
'Logger_Shlink',
|
|
|
|
],
|
2018-12-01 23:38:29 +03:00
|
|
|
|
2020-03-22 19:05:59 +03:00
|
|
|
Resolver\PersistenceDomainResolver::class => ['em'],
|
2020-04-12 18:05:59 +03:00
|
|
|
|
|
|
|
Mercure\MercureUpdatesGenerator::class => ['config.url_shortener.domain'],
|
2017-07-22 14:48:30 +03:00
|
|
|
],
|
|
|
|
|
2016-07-19 19:01:39 +03:00
|
|
|
];
|