2019-07-13 05:04:21 -05:00
|
|
|
<?php
|
2019-10-05 10:26:10 -05:00
|
|
|
|
2019-07-13 05:04:21 -05:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Shlinkio\Shlink\Core;
|
|
|
|
|
2020-01-01 14:11:53 -06:00
|
|
|
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
2021-12-11 14:04:16 -06:00
|
|
|
use PhpAmqpLib\Connection\AMQPStreamConnection;
|
2019-12-28 06:07:11 -06:00
|
|
|
use Psr\EventDispatcher\EventDispatcherInterface;
|
2021-04-07 09:29:29 -05:00
|
|
|
use Shlinkio\Shlink\CLI\Util\GeolocationDbUpdater;
|
2021-04-07 04:35:02 -05:00
|
|
|
use Shlinkio\Shlink\IpGeolocation\GeoLite2\DbUpdater;
|
2019-08-10 06:56:06 -05:00
|
|
|
use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface;
|
2021-04-02 02:46:02 -05:00
|
|
|
use Symfony\Component\Mercure\Hub;
|
2019-07-13 05:04:21 -05:00
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'events' => [
|
2019-12-28 06:50:41 -06:00
|
|
|
'regular' => [
|
2021-04-07 04:35:02 -05:00
|
|
|
EventDispatcher\Event\UrlVisited::class => [
|
|
|
|
EventDispatcher\LocateVisit::class,
|
2019-12-28 06:50:41 -06:00
|
|
|
],
|
|
|
|
],
|
2019-07-18 12:07:07 -05:00
|
|
|
'async' => [
|
2021-04-07 04:35:02 -05:00
|
|
|
EventDispatcher\Event\VisitLocated::class => [
|
|
|
|
EventDispatcher\NotifyVisitToMercure::class,
|
2021-12-12 03:32:57 -06:00
|
|
|
EventDispatcher\NotifyVisitToRabbitMq::class,
|
2021-04-07 04:35:02 -05:00
|
|
|
EventDispatcher\NotifyVisitToWebHooks::class,
|
2021-04-07 09:29:29 -05:00
|
|
|
EventDispatcher\UpdateGeoLiteDb::class,
|
2019-07-18 12:07:07 -05:00
|
|
|
],
|
2019-07-13 05:04:21 -05:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
'dependencies' => [
|
2019-07-13 08:43:54 -05:00
|
|
|
'factories' => [
|
2021-02-09 13:25:28 -06:00
|
|
|
EventDispatcher\LocateVisit::class => ConfigAbstractFactory::class,
|
2019-12-28 06:50:41 -06:00
|
|
|
EventDispatcher\NotifyVisitToWebHooks::class => ConfigAbstractFactory::class,
|
2020-04-12 10:05:59 -05:00
|
|
|
EventDispatcher\NotifyVisitToMercure::class => ConfigAbstractFactory::class,
|
2021-12-12 03:32:57 -06:00
|
|
|
EventDispatcher\NotifyVisitToRabbitMq::class => ConfigAbstractFactory::class,
|
2021-04-07 09:29:29 -05:00
|
|
|
EventDispatcher\UpdateGeoLiteDb::class => ConfigAbstractFactory::class,
|
2019-07-13 08:43:54 -05:00
|
|
|
],
|
2020-04-11 11:00:29 -05:00
|
|
|
|
|
|
|
'delegators' => [
|
2021-04-07 04:35:02 -05:00
|
|
|
EventDispatcher\NotifyVisitToMercure::class => [
|
|
|
|
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
|
|
|
],
|
2021-12-12 03:32:57 -06:00
|
|
|
EventDispatcher\NotifyVisitToRabbitMq::class => [
|
2021-12-11 14:04:16 -06:00
|
|
|
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
|
|
|
],
|
2021-04-07 04:35:02 -05:00
|
|
|
EventDispatcher\NotifyVisitToWebHooks::class => [
|
2020-04-11 11:00:29 -05:00
|
|
|
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
|
|
|
],
|
|
|
|
],
|
2019-07-13 05:04:21 -05:00
|
|
|
],
|
|
|
|
|
|
|
|
ConfigAbstractFactory::class => [
|
2021-02-09 13:25:28 -06:00
|
|
|
EventDispatcher\LocateVisit::class => [
|
2019-07-20 04:21:00 -05:00
|
|
|
IpLocationResolverInterface::class,
|
|
|
|
'em',
|
|
|
|
'Logger_Shlink',
|
2021-04-07 04:35:02 -05:00
|
|
|
DbUpdater::class,
|
2019-12-28 06:07:11 -06:00
|
|
|
EventDispatcherInterface::class,
|
2019-07-20 04:21:00 -05:00
|
|
|
],
|
2019-12-27 02:25:07 -06:00
|
|
|
EventDispatcher\NotifyVisitToWebHooks::class => [
|
|
|
|
'httpClient',
|
|
|
|
'em',
|
|
|
|
'Logger_Shlink',
|
2021-10-09 03:53:21 -05:00
|
|
|
Options\WebhookOptions::class,
|
2021-02-01 15:55:52 -06:00
|
|
|
ShortUrl\Transformer\ShortUrlDataTransformer::class,
|
2019-12-28 06:50:41 -06:00
|
|
|
Options\AppOptions::class,
|
2019-12-27 02:25:07 -06:00
|
|
|
],
|
2020-04-12 10:05:59 -05:00
|
|
|
EventDispatcher\NotifyVisitToMercure::class => [
|
2021-04-02 02:46:02 -05:00
|
|
|
Hub::class,
|
2020-04-12 10:05:59 -05:00
|
|
|
Mercure\MercureUpdatesGenerator::class,
|
|
|
|
'em',
|
|
|
|
'Logger_Shlink',
|
|
|
|
],
|
2021-12-12 03:32:57 -06:00
|
|
|
EventDispatcher\NotifyVisitToRabbitMq::class => [
|
2021-12-11 14:04:16 -06:00
|
|
|
AMQPStreamConnection::class,
|
|
|
|
'em',
|
|
|
|
'Logger_Shlink',
|
|
|
|
Visit\Transformer\OrphanVisitDataTransformer::class,
|
2021-12-12 03:32:57 -06:00
|
|
|
'config.rabbitmq.enabled',
|
2021-12-11 14:04:16 -06:00
|
|
|
],
|
2021-04-07 09:29:29 -05:00
|
|
|
EventDispatcher\UpdateGeoLiteDb::class => [GeolocationDbUpdater::class, 'Logger_Shlink'],
|
2019-07-13 05:04:21 -05:00
|
|
|
],
|
|
|
|
|
|
|
|
];
|