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;
|
2019-07-20 12:21:00 +03:00
|
|
|
use Shlinkio\Shlink\CLI\Util\GeolocationDbUpdater;
|
2019-08-10 14:56:06 +03:00
|
|
|
use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface;
|
2020-04-12 18:05:59 +03:00
|
|
|
use Symfony\Component\Mercure\Publisher;
|
2019-07-13 13:04:21 +03:00
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'events' => [
|
2019-12-28 15:50:41 +03:00
|
|
|
'regular' => [
|
2021-01-17 13:42:35 +03:00
|
|
|
EventDispatcher\Event\VisitLocated::class => [
|
2020-04-12 18:05:59 +03:00
|
|
|
EventDispatcher\NotifyVisitToMercure::class,
|
2019-12-28 15:50:41 +03:00
|
|
|
EventDispatcher\NotifyVisitToWebHooks::class,
|
|
|
|
],
|
|
|
|
],
|
2019-07-18 20:07:07 +03:00
|
|
|
'async' => [
|
2021-02-09 22:25:28 +03:00
|
|
|
EventDispatcher\Event\UrlVisited::class => [
|
|
|
|
EventDispatcher\LocateVisit::class,
|
2019-07-18 20:07:07 +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,
|
2019-12-28 15:50:41 +03:00
|
|
|
EventDispatcher\NotifyVisitToWebHooks::class => ConfigAbstractFactory::class,
|
2020-04-12 18:05:59 +03:00
|
|
|
EventDispatcher\NotifyVisitToMercure::class => ConfigAbstractFactory::class,
|
2019-07-13 16:43:54 +03:00
|
|
|
],
|
2020-04-11 19:00:29 +03:00
|
|
|
|
|
|
|
'delegators' => [
|
2021-02-09 22:25:28 +03:00
|
|
|
EventDispatcher\LocateVisit::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',
|
|
|
|
GeolocationDbUpdater::class,
|
2019-12-28 15:07:11 +03:00
|
|
|
EventDispatcherInterface::class,
|
2019-07-20 12:21:00 +03:00
|
|
|
],
|
2019-12-27 11:25:07 +03:00
|
|
|
EventDispatcher\NotifyVisitToWebHooks::class => [
|
|
|
|
'httpClient',
|
|
|
|
'em',
|
|
|
|
'Logger_Shlink',
|
|
|
|
'config.url_shortener.visits_webhooks',
|
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
|
|
|
],
|
2020-04-12 18:05:59 +03:00
|
|
|
EventDispatcher\NotifyVisitToMercure::class => [
|
|
|
|
Publisher::class,
|
|
|
|
Mercure\MercureUpdatesGenerator::class,
|
|
|
|
'em',
|
|
|
|
'Logger_Shlink',
|
|
|
|
],
|
2019-07-13 13:04:21 +03:00
|
|
|
],
|
|
|
|
|
|
|
|
];
|