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