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