2019-07-13 13:04:21 +03:00
|
|
|
<?php
|
2019-10-05 18:26:10 +03:00
|
|
|
|
2019-07-13 13:04:21 +03:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Shlinkio\Shlink\Core;
|
|
|
|
|
2020-01-01 23:11:53 +03:00
|
|
|
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
2019-12-28 15:07:11 +03:00
|
|
|
use Psr\EventDispatcher\EventDispatcherInterface;
|
2022-09-18 11:01:22 +03:00
|
|
|
use Shlinkio\Shlink\CLI\GeoLite\GeolocationDbUpdater;
|
2022-07-26 11:17:50 +03:00
|
|
|
use Shlinkio\Shlink\Common\Cache\RedisPublishingHelper;
|
2022-07-26 13:17:37 +03:00
|
|
|
use Shlinkio\Shlink\Common\Mercure\MercureHubPublishingHelper;
|
2022-07-24 11:12:26 +03:00
|
|
|
use Shlinkio\Shlink\Common\RabbitMq\RabbitMqPublishingHelper;
|
2022-09-18 18:00:03 +03:00
|
|
|
use Shlinkio\Shlink\Core\Visit\VisitLocator;
|
2022-09-18 19:44:01 +03:00
|
|
|
use Shlinkio\Shlink\Core\Visit\VisitToLocationHelper;
|
2021-04-07 12:35:02 +03:00
|
|
|
use Shlinkio\Shlink\IpGeolocation\GeoLite2\DbUpdater;
|
2019-08-10 14:56:06 +03:00
|
|
|
use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface;
|
2019-07-13 13:04:21 +03:00
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'events' => [
|
2019-12-28 15:50:41 +03:00
|
|
|
'regular' => [
|
2021-04-07 12:35:02 +03:00
|
|
|
EventDispatcher\Event\UrlVisited::class => [
|
|
|
|
EventDispatcher\LocateVisit::class,
|
2019-12-28 15:50:41 +03:00
|
|
|
],
|
2022-09-18 12:17:17 +03:00
|
|
|
EventDispatcher\Event\GeoLiteDbCreated::class => [
|
2022-09-18 18:00:03 +03:00
|
|
|
EventDispatcher\LocateUnlocatedVisits::class,
|
2022-09-18 12:17:17 +03:00
|
|
|
],
|
2019-12-28 15:50:41 +03:00
|
|
|
],
|
2019-07-18 20:07:07 +03:00
|
|
|
'async' => [
|
2021-04-07 12:35:02 +03:00
|
|
|
EventDispatcher\Event\VisitLocated::class => [
|
2022-07-21 21:07:28 +03:00
|
|
|
EventDispatcher\Mercure\NotifyVisitToMercure::class,
|
|
|
|
EventDispatcher\RabbitMq\NotifyVisitToRabbitMq::class,
|
2022-07-25 19:23:13 +03:00
|
|
|
EventDispatcher\RedisPubSub\NotifyVisitToRedis::class,
|
2021-04-07 12:35:02 +03:00
|
|
|
EventDispatcher\NotifyVisitToWebHooks::class,
|
2021-04-07 17:29:29 +03:00
|
|
|
EventDispatcher\UpdateGeoLiteDb::class,
|
2019-07-18 20:07:07 +03:00
|
|
|
],
|
2022-07-24 11:12:26 +03:00
|
|
|
EventDispatcher\Event\ShortUrlCreated::class => [
|
2022-07-24 20:00:48 +03:00
|
|
|
EventDispatcher\Mercure\NotifyNewShortUrlToMercure::class,
|
2022-07-24 11:12:26 +03:00
|
|
|
EventDispatcher\RabbitMq\NotifyNewShortUrlToRabbitMq::class,
|
2022-07-25 19:23:13 +03:00
|
|
|
EventDispatcher\RedisPubSub\NotifyNewShortUrlToRedis::class,
|
2022-07-24 11:12:26 +03:00
|
|
|
],
|
2019-07-13 13:04:21 +03:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
'dependencies' => [
|
2019-07-13 16:43:54 +03:00
|
|
|
'factories' => [
|
2021-02-09 22:25:28 +03:00
|
|
|
EventDispatcher\LocateVisit::class => ConfigAbstractFactory::class,
|
2022-09-18 18:00:03 +03:00
|
|
|
EventDispatcher\LocateUnlocatedVisits::class => ConfigAbstractFactory::class,
|
2019-12-28 15:50:41 +03:00
|
|
|
EventDispatcher\NotifyVisitToWebHooks::class => ConfigAbstractFactory::class,
|
2022-07-21 21:07:28 +03:00
|
|
|
EventDispatcher\Mercure\NotifyVisitToMercure::class => ConfigAbstractFactory::class,
|
2022-07-24 20:00:48 +03:00
|
|
|
EventDispatcher\Mercure\NotifyNewShortUrlToMercure::class => ConfigAbstractFactory::class,
|
2022-07-21 21:07:28 +03:00
|
|
|
EventDispatcher\RabbitMq\NotifyVisitToRabbitMq::class => ConfigAbstractFactory::class,
|
2022-07-24 11:18:19 +03:00
|
|
|
EventDispatcher\RabbitMq\NotifyNewShortUrlToRabbitMq::class => ConfigAbstractFactory::class,
|
2022-07-25 19:23:13 +03:00
|
|
|
EventDispatcher\RedisPubSub\NotifyVisitToRedis::class => ConfigAbstractFactory::class,
|
|
|
|
EventDispatcher\RedisPubSub\NotifyNewShortUrlToRedis::class => ConfigAbstractFactory::class,
|
2021-04-07 17:29:29 +03:00
|
|
|
EventDispatcher\UpdateGeoLiteDb::class => ConfigAbstractFactory::class,
|
2019-07-13 16:43:54 +03:00
|
|
|
],
|
2020-04-11 19:00:29 +03:00
|
|
|
|
|
|
|
'delegators' => [
|
2022-07-21 21:07:28 +03:00
|
|
|
EventDispatcher\Mercure\NotifyVisitToMercure::class => [
|
2021-04-07 12:35:02 +03:00
|
|
|
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
|
|
|
],
|
2022-07-24 20:00:48 +03:00
|
|
|
EventDispatcher\Mercure\NotifyNewShortUrlToMercure::class => [
|
|
|
|
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
|
|
|
],
|
2022-07-21 21:07:28 +03:00
|
|
|
EventDispatcher\RabbitMq\NotifyVisitToRabbitMq::class => [
|
2021-12-11 23:04:16 +03:00
|
|
|
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
|
|
|
],
|
2022-07-24 11:18:19 +03:00
|
|
|
EventDispatcher\RabbitMq\NotifyNewShortUrlToRabbitMq::class => [
|
|
|
|
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
|
|
|
],
|
2022-07-25 19:23:13 +03:00
|
|
|
EventDispatcher\RedisPubSub\NotifyVisitToRedis::class => [
|
|
|
|
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
|
|
|
],
|
|
|
|
EventDispatcher\RedisPubSub\NotifyNewShortUrlToRedis::class => [
|
|
|
|
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
|
|
|
],
|
2022-09-18 18:00:03 +03:00
|
|
|
EventDispatcher\LocateUnlocatedVisits::class => [
|
|
|
|
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
|
|
|
],
|
2021-04-07 12:35:02 +03:00
|
|
|
EventDispatcher\NotifyVisitToWebHooks::class => [
|
2020-04-11 19:00:29 +03:00
|
|
|
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
|
|
|
],
|
|
|
|
],
|
2019-07-13 13:04:21 +03:00
|
|
|
],
|
|
|
|
|
|
|
|
ConfigAbstractFactory::class => [
|
2021-02-09 22:25:28 +03:00
|
|
|
EventDispatcher\LocateVisit::class => [
|
2019-07-20 12:21:00 +03:00
|
|
|
IpLocationResolverInterface::class,
|
|
|
|
'em',
|
|
|
|
'Logger_Shlink',
|
2021-04-07 12:35:02 +03:00
|
|
|
DbUpdater::class,
|
2019-12-28 15:07:11 +03:00
|
|
|
EventDispatcherInterface::class,
|
2019-07-20 12:21:00 +03:00
|
|
|
],
|
2022-09-18 19:44:01 +03:00
|
|
|
EventDispatcher\LocateUnlocatedVisits::class => [VisitLocator::class, VisitToLocationHelper::class],
|
2019-12-27 11:25:07 +03:00
|
|
|
EventDispatcher\NotifyVisitToWebHooks::class => [
|
|
|
|
'httpClient',
|
|
|
|
'em',
|
|
|
|
'Logger_Shlink',
|
2021-10-09 11:53:21 +03:00
|
|
|
Options\WebhookOptions::class,
|
2021-02-02 00:55:52 +03:00
|
|
|
ShortUrl\Transformer\ShortUrlDataTransformer::class,
|
2019-12-28 15:50:41 +03:00
|
|
|
Options\AppOptions::class,
|
2019-12-27 11:25:07 +03:00
|
|
|
],
|
2022-07-21 21:07:28 +03:00
|
|
|
EventDispatcher\Mercure\NotifyVisitToMercure::class => [
|
2022-07-26 13:17:37 +03:00
|
|
|
MercureHubPublishingHelper::class,
|
2022-07-27 10:38:47 +03:00
|
|
|
EventDispatcher\PublishingUpdatesGenerator::class,
|
2020-04-12 18:05:59 +03:00
|
|
|
'em',
|
|
|
|
'Logger_Shlink',
|
|
|
|
],
|
2022-07-24 20:00:48 +03:00
|
|
|
EventDispatcher\Mercure\NotifyNewShortUrlToMercure::class => [
|
2022-07-26 13:17:37 +03:00
|
|
|
MercureHubPublishingHelper::class,
|
2022-07-27 10:38:47 +03:00
|
|
|
EventDispatcher\PublishingUpdatesGenerator::class,
|
2022-07-24 20:00:48 +03:00
|
|
|
'em',
|
|
|
|
'Logger_Shlink',
|
|
|
|
],
|
2022-07-21 21:07:28 +03:00
|
|
|
EventDispatcher\RabbitMq\NotifyVisitToRabbitMq::class => [
|
2022-07-24 11:12:26 +03:00
|
|
|
RabbitMqPublishingHelper::class,
|
2022-07-27 18:41:48 +03:00
|
|
|
EventDispatcher\PublishingUpdatesGenerator::class,
|
2021-12-11 23:04:16 +03:00
|
|
|
'em',
|
|
|
|
'Logger_Shlink',
|
|
|
|
Visit\Transformer\OrphanVisitDataTransformer::class,
|
2022-07-25 13:08:22 +03:00
|
|
|
Options\RabbitMqOptions::class,
|
2021-12-11 23:04:16 +03:00
|
|
|
],
|
2022-07-24 11:18:19 +03:00
|
|
|
EventDispatcher\RabbitMq\NotifyNewShortUrlToRabbitMq::class => [
|
|
|
|
RabbitMqPublishingHelper::class,
|
2022-07-27 11:18:28 +03:00
|
|
|
EventDispatcher\PublishingUpdatesGenerator::class,
|
2022-07-24 11:18:19 +03:00
|
|
|
'em',
|
|
|
|
'Logger_Shlink',
|
2022-07-25 13:08:22 +03:00
|
|
|
Options\RabbitMqOptions::class,
|
2022-07-24 11:18:19 +03:00
|
|
|
],
|
2022-07-26 11:17:50 +03:00
|
|
|
EventDispatcher\RedisPubSub\NotifyVisitToRedis::class => [
|
|
|
|
RedisPublishingHelper::class,
|
2022-07-27 17:55:19 +03:00
|
|
|
EventDispatcher\PublishingUpdatesGenerator::class,
|
2022-07-26 11:17:50 +03:00
|
|
|
'em',
|
|
|
|
'Logger_Shlink',
|
|
|
|
'config.redis.pub_sub_enabled',
|
|
|
|
],
|
|
|
|
EventDispatcher\RedisPubSub\NotifyNewShortUrlToRedis::class => [
|
|
|
|
RedisPublishingHelper::class,
|
2022-07-27 17:47:21 +03:00
|
|
|
EventDispatcher\PublishingUpdatesGenerator::class,
|
2022-07-26 11:17:50 +03:00
|
|
|
'em',
|
|
|
|
'Logger_Shlink',
|
|
|
|
'config.redis.pub_sub_enabled',
|
|
|
|
],
|
2022-09-18 12:17:17 +03:00
|
|
|
EventDispatcher\UpdateGeoLiteDb::class => [
|
|
|
|
GeolocationDbUpdater::class,
|
|
|
|
'Logger_Shlink',
|
|
|
|
EventDispatcherInterface::class,
|
|
|
|
],
|
2019-07-13 13:04:21 +03:00
|
|
|
],
|
|
|
|
|
|
|
|
];
|