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;
|
|
|
|
|
2020-01-01 14:11:53 -06:00
|
|
|
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
2020-11-22 11:03:27 -06:00
|
|
|
use Laminas\ServiceManager\Factory\InvokableFactory;
|
2019-07-13 05:04:21 -05:00
|
|
|
use Psr\EventDispatcher\EventDispatcherInterface;
|
2019-11-23 03:25:12 -06:00
|
|
|
use Shlinkio\Shlink\Core\ErrorHandler;
|
2019-11-02 12:33:26 -05:00
|
|
|
use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions;
|
2020-10-22 11:12:22 -05:00
|
|
|
use Shlinkio\Shlink\Importer\ImportedLinksProcessorInterface;
|
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' => [
|
2021-02-08 14:38:19 -06:00
|
|
|
ErrorHandler\NotFoundTypeResolverMiddleware::class => ConfigAbstractFactory::class,
|
|
|
|
ErrorHandler\NotFoundTrackerMiddleware::class => ConfigAbstractFactory::class,
|
2019-11-23 03:25:12 -06:00
|
|
|
ErrorHandler\NotFoundRedirectHandler::class => ConfigAbstractFactory::class,
|
2020-11-22 11:03:27 -06:00
|
|
|
ErrorHandler\NotFoundTemplateHandler::class => InvokableFactory::class,
|
2018-12-01 14:38:29 -06:00
|
|
|
|
2018-11-03 05:37:43 -05:00
|
|
|
Options\AppOptions::class => ConfigAbstractFactory::class,
|
|
|
|
Options\DeleteShortUrlsOptions::class => ConfigAbstractFactory::class,
|
2019-11-02 11:23:21 -05:00
|
|
|
Options\NotFoundRedirectOptions::class => ConfigAbstractFactory::class,
|
2022-01-16 08:34:07 -06:00
|
|
|
Options\RedirectOptions::class => ConfigAbstractFactory::class,
|
2018-12-01 14:38:29 -06:00
|
|
|
Options\UrlShortenerOptions::class => ConfigAbstractFactory::class,
|
2021-05-16 02:30:04 -05:00
|
|
|
Options\TrackingOptions::class => ConfigAbstractFactory::class,
|
2021-09-26 06:25:02 -05:00
|
|
|
Options\QrCodeOptions::class => ConfigAbstractFactory::class,
|
2021-10-09 03:53:21 -05:00
|
|
|
Options\WebhookOptions::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\ShortUrlService::class => ConfigAbstractFactory::class,
|
2018-09-15 05:56:17 -05:00
|
|
|
Service\ShortUrl\DeleteShortUrlService::class => ConfigAbstractFactory::class,
|
2020-01-26 12:21:51 -06:00
|
|
|
Service\ShortUrl\ShortUrlResolver::class => ConfigAbstractFactory::class,
|
2020-10-25 05:16:42 -05:00
|
|
|
Service\ShortUrl\ShortCodeHelper::class => ConfigAbstractFactory::class,
|
2021-02-09 15:11:09 -06:00
|
|
|
|
|
|
|
Tag\TagService::class => ConfigAbstractFactory::class,
|
|
|
|
|
2020-09-27 02:53:12 -05:00
|
|
|
Domain\DomainService::class => ConfigAbstractFactory::class,
|
2016-07-19 11:01:39 -05:00
|
|
|
|
2021-02-09 15:11:09 -06:00
|
|
|
Visit\VisitsTracker::class => ConfigAbstractFactory::class,
|
2021-07-15 10:23:09 -05:00
|
|
|
Visit\RequestTracker::class => ConfigAbstractFactory::class,
|
2021-02-09 15:11:09 -06:00
|
|
|
Visit\VisitLocator::class => ConfigAbstractFactory::class,
|
|
|
|
Visit\VisitsStatsHelper::class => ConfigAbstractFactory::class,
|
|
|
|
Visit\Transformer\OrphanVisitDataTransformer::class => InvokableFactory::class,
|
|
|
|
|
2019-11-16 03:06:55 -06:00
|
|
|
Util\UrlValidator::class => ConfigAbstractFactory::class,
|
2020-10-25 07:20:34 -05:00
|
|
|
Util\DoctrineBatchHelper::class => ConfigAbstractFactory::class,
|
2020-11-10 11:08:25 -06:00
|
|
|
Util\RedirectResponseHelper::class => ConfigAbstractFactory::class,
|
2019-11-16 03:06:55 -06:00
|
|
|
|
2021-07-21 02:28:21 -05:00
|
|
|
Config\NotFoundRedirectResolver::class => ConfigAbstractFactory::class,
|
|
|
|
|
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,
|
2021-05-22 00:15:34 -05:00
|
|
|
Action\RobotsAction::class => ConfigAbstractFactory::class,
|
2018-12-01 14:38:29 -06:00
|
|
|
|
2020-11-07 02:31:46 -06:00
|
|
|
ShortUrl\Resolver\PersistenceShortUrlRelationResolver::class => ConfigAbstractFactory::class,
|
2021-02-01 15:55:52 -06:00
|
|
|
ShortUrl\Helper\ShortUrlStringifier::class => ConfigAbstractFactory::class,
|
2021-02-05 10:59:34 -06:00
|
|
|
ShortUrl\Helper\ShortUrlTitleResolutionHelper::class => ConfigAbstractFactory::class,
|
2021-07-14 09:36:03 -05:00
|
|
|
ShortUrl\Helper\ShortUrlRedirectionBuilder::class => ConfigAbstractFactory::class,
|
2021-02-01 15:55:52 -06:00
|
|
|
ShortUrl\Transformer\ShortUrlDataTransformer::class => ConfigAbstractFactory::class,
|
2021-07-15 09:54:54 -05:00
|
|
|
ShortUrl\Middleware\ExtraPathRedirectMiddleware::class => ConfigAbstractFactory::class,
|
2020-04-12 10:05:59 -05:00
|
|
|
|
|
|
|
Mercure\MercureUpdatesGenerator::class => ConfigAbstractFactory::class,
|
2020-10-22 11:12:22 -05:00
|
|
|
|
|
|
|
Importer\ImportedLinksProcessor::class => ConfigAbstractFactory::class,
|
2021-05-22 00:15:34 -05:00
|
|
|
|
2021-05-22 02:34:42 -05:00
|
|
|
Crawling\CrawlingHelper::class => ConfigAbstractFactory::class,
|
2020-10-22 11:12:22 -05:00
|
|
|
],
|
|
|
|
|
|
|
|
'aliases' => [
|
|
|
|
ImportedLinksProcessorInterface::class => Importer\ImportedLinksProcessor::class,
|
2016-07-19 11:01:39 -05:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
2017-07-22 06:48:30 -05:00
|
|
|
ConfigAbstractFactory::class => [
|
2021-02-08 14:38:19 -06:00
|
|
|
ErrorHandler\NotFoundTypeResolverMiddleware::class => ['config.router.base_path'],
|
2021-07-15 10:23:09 -05:00
|
|
|
ErrorHandler\NotFoundTrackerMiddleware::class => [Visit\RequestTracker::class],
|
2020-11-10 11:08:25 -06:00
|
|
|
ErrorHandler\NotFoundRedirectHandler::class => [
|
|
|
|
NotFoundRedirectOptions::class,
|
2021-07-21 02:28:21 -05:00
|
|
|
Config\NotFoundRedirectResolver::class,
|
|
|
|
Domain\DomainService::class,
|
2020-11-10 11:08:25 -06:00
|
|
|
],
|
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'],
|
2019-11-02 11:23:21 -05:00
|
|
|
Options\NotFoundRedirectOptions::class => ['config.not_found_redirects'],
|
2022-01-16 08:34:07 -06:00
|
|
|
Options\RedirectOptions::class => ['config.redirects'],
|
2018-12-01 14:38:29 -06:00
|
|
|
Options\UrlShortenerOptions::class => ['config.url_shortener'],
|
2021-05-16 02:30:04 -05:00
|
|
|
Options\TrackingOptions::class => ['config.tracking'],
|
2021-09-26 06:25:02 -05:00
|
|
|
Options\QrCodeOptions::class => ['config.qr_codes'],
|
2022-01-16 08:34:07 -06:00
|
|
|
Options\WebhookOptions::class => ['config.visits_webhooks'],
|
2018-11-03 05:37:43 -05:00
|
|
|
|
2020-10-25 05:16:42 -05:00
|
|
|
Service\UrlShortener::class => [
|
2021-02-05 10:59:34 -06:00
|
|
|
ShortUrl\Helper\ShortUrlTitleResolutionHelper::class,
|
2020-10-25 05:16:42 -05:00
|
|
|
'em',
|
2020-11-07 02:31:46 -06:00
|
|
|
ShortUrl\Resolver\PersistenceShortUrlRelationResolver::class,
|
2020-10-25 05:16:42 -05:00
|
|
|
Service\ShortUrl\ShortCodeHelper::class,
|
|
|
|
],
|
2021-02-08 12:50:17 -06:00
|
|
|
Visit\VisitsTracker::class => [
|
2020-05-08 06:10:58 -05:00
|
|
|
'em',
|
|
|
|
EventDispatcherInterface::class,
|
2021-05-16 02:30:04 -05:00
|
|
|
Options\TrackingOptions::class,
|
2020-05-08 06:10:58 -05:00
|
|
|
],
|
2021-07-15 10:23:09 -05:00
|
|
|
Visit\RequestTracker::class => [Visit\VisitsTracker::class, Options\TrackingOptions::class],
|
2021-01-31 05:12:21 -06:00
|
|
|
Service\ShortUrlService::class => [
|
|
|
|
'em',
|
|
|
|
Service\ShortUrl\ShortUrlResolver::class,
|
2021-02-05 10:59:34 -06:00
|
|
|
ShortUrl\Helper\ShortUrlTitleResolutionHelper::class,
|
2021-01-31 05:12:21 -06:00
|
|
|
ShortUrl\Resolver\PersistenceShortUrlRelationResolver::class,
|
|
|
|
],
|
2020-03-26 16:17:13 -05:00
|
|
|
Visit\VisitLocator::class => ['em'],
|
2020-05-01 04:40:02 -05:00
|
|
|
Visit\VisitsStatsHelper::class => ['em'],
|
2020-05-08 03:15:33 -05:00
|
|
|
Tag\TagService::class => ['em'],
|
2020-02-01 15:54:02 -06:00
|
|
|
Service\ShortUrl\DeleteShortUrlService::class => [
|
|
|
|
'em',
|
|
|
|
Options\DeleteShortUrlsOptions::class,
|
|
|
|
Service\ShortUrl\ShortUrlResolver::class,
|
|
|
|
],
|
2020-01-26 12:21:51 -06:00
|
|
|
Service\ShortUrl\ShortUrlResolver::class => ['em'],
|
2020-10-25 05:16:42 -05:00
|
|
|
Service\ShortUrl\ShortCodeHelper::class => ['em'],
|
2021-12-09 05:32:02 -06:00
|
|
|
Domain\DomainService::class => ['em', 'config.url_shortener.domain.hostname'],
|
2017-07-22 06:48:30 -05:00
|
|
|
|
2020-03-22 10:58:28 -05:00
|
|
|
Util\UrlValidator::class => ['httpClient', Options\UrlShortenerOptions::class],
|
2020-10-25 07:20:34 -05:00
|
|
|
Util\DoctrineBatchHelper::class => ['em'],
|
2022-01-16 08:34:07 -06:00
|
|
|
Util\RedirectResponseHelper::class => [Options\RedirectOptions::class],
|
2019-11-16 03:06:55 -06:00
|
|
|
|
2021-10-03 09:45:13 -05:00
|
|
|
Config\NotFoundRedirectResolver::class => [Util\RedirectResponseHelper::class, 'Logger_Shlink'],
|
2021-07-21 02:28:21 -05:00
|
|
|
|
2018-01-14 02:24:33 -06:00
|
|
|
Action\RedirectAction::class => [
|
2020-01-26 12:21:51 -06:00
|
|
|
Service\ShortUrl\ShortUrlResolver::class,
|
2021-07-15 10:23:09 -05:00
|
|
|
Visit\RequestTracker::class,
|
2021-07-15 06:28:31 -05:00
|
|
|
ShortUrl\Helper\ShortUrlRedirectionBuilder::class,
|
2020-11-10 11:08:25 -06:00
|
|
|
Util\RedirectResponseHelper::class,
|
2018-01-14 02:24:33 -06:00
|
|
|
],
|
2021-07-15 10:23:09 -05:00
|
|
|
Action\PixelAction::class => [Service\ShortUrl\ShortUrlResolver::class, Visit\RequestTracker::class],
|
2020-01-26 12:21:51 -06:00
|
|
|
Action\QrCodeAction::class => [
|
|
|
|
Service\ShortUrl\ShortUrlResolver::class,
|
2021-02-01 15:55:52 -06:00
|
|
|
ShortUrl\Helper\ShortUrlStringifier::class,
|
2020-01-26 12:21:51 -06:00
|
|
|
'Logger_Shlink',
|
2021-09-26 06:25:02 -05:00
|
|
|
Options\QrCodeOptions::class,
|
2020-01-26 12:21:51 -06:00
|
|
|
],
|
2021-05-22 00:15:34 -05:00
|
|
|
Action\RobotsAction::class => [Crawling\CrawlingHelper::class],
|
2018-12-01 14:38:29 -06:00
|
|
|
|
2020-11-07 02:31:46 -06:00
|
|
|
ShortUrl\Resolver\PersistenceShortUrlRelationResolver::class => ['em'],
|
2021-02-01 16:18:19 -06:00
|
|
|
ShortUrl\Helper\ShortUrlStringifier::class => ['config.url_shortener.domain', 'config.router.base_path'],
|
2021-02-05 10:59:34 -06:00
|
|
|
ShortUrl\Helper\ShortUrlTitleResolutionHelper::class => [Util\UrlValidator::class],
|
2021-07-14 09:36:03 -05:00
|
|
|
ShortUrl\Helper\ShortUrlRedirectionBuilder::class => [Options\TrackingOptions::class],
|
2021-02-01 15:55:52 -06:00
|
|
|
ShortUrl\Transformer\ShortUrlDataTransformer::class => [ShortUrl\Helper\ShortUrlStringifier::class],
|
2021-07-15 09:54:54 -05:00
|
|
|
ShortUrl\Middleware\ExtraPathRedirectMiddleware::class => [
|
|
|
|
Service\ShortUrl\ShortUrlResolver::class,
|
2021-07-15 10:23:09 -05:00
|
|
|
Visit\RequestTracker::class,
|
2021-07-15 09:54:54 -05:00
|
|
|
ShortUrl\Helper\ShortUrlRedirectionBuilder::class,
|
|
|
|
Util\RedirectResponseHelper::class,
|
|
|
|
Options\UrlShortenerOptions::class,
|
|
|
|
],
|
2020-04-12 10:05:59 -05:00
|
|
|
|
2021-02-11 15:12:38 -06:00
|
|
|
Mercure\MercureUpdatesGenerator::class => [
|
|
|
|
ShortUrl\Transformer\ShortUrlDataTransformer::class,
|
|
|
|
Visit\Transformer\OrphanVisitDataTransformer::class,
|
|
|
|
],
|
2020-10-22 11:12:22 -05:00
|
|
|
|
2020-10-25 05:16:42 -05:00
|
|
|
Importer\ImportedLinksProcessor::class => [
|
|
|
|
'em',
|
2020-11-07 02:31:46 -06:00
|
|
|
ShortUrl\Resolver\PersistenceShortUrlRelationResolver::class,
|
2020-10-25 05:16:42 -05:00
|
|
|
Service\ShortUrl\ShortCodeHelper::class,
|
2020-10-25 07:20:34 -05:00
|
|
|
Util\DoctrineBatchHelper::class,
|
2020-10-25 05:16:42 -05:00
|
|
|
],
|
2021-05-22 02:34:42 -05:00
|
|
|
|
|
|
|
Crawling\CrawlingHelper::class => ['em'],
|
2017-07-22 06:48:30 -05:00
|
|
|
],
|
|
|
|
|
2016-07-19 11:01:39 -05:00
|
|
|
];
|