event_dispatcher.config.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. declare(strict_types=1);
  3. namespace Shlinkio\Shlink\Core;
  4. use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
  5. use Psr\EventDispatcher\EventDispatcherInterface;
  6. use Shlinkio\Shlink\CLI\Util\GeolocationDbUpdater;
  7. use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface;
  8. return [
  9. 'events' => [
  10. 'regular' => [
  11. EventDispatcher\VisitLocated::class => [
  12. EventDispatcher\NotifyVisitToWebHooks::class,
  13. ],
  14. ],
  15. 'async' => [
  16. EventDispatcher\ShortUrlVisited::class => [
  17. EventDispatcher\LocateShortUrlVisit::class,
  18. ],
  19. ],
  20. ],
  21. 'dependencies' => [
  22. 'factories' => [
  23. EventDispatcher\LocateShortUrlVisit::class => ConfigAbstractFactory::class,
  24. EventDispatcher\NotifyVisitToWebHooks::class => ConfigAbstractFactory::class,
  25. ],
  26. ],
  27. ConfigAbstractFactory::class => [
  28. EventDispatcher\LocateShortUrlVisit::class => [
  29. IpLocationResolverInterface::class,
  30. 'em',
  31. 'Logger_Shlink',
  32. GeolocationDbUpdater::class,
  33. EventDispatcherInterface::class,
  34. ],
  35. EventDispatcher\NotifyVisitToWebHooks::class => [
  36. 'httpClient',
  37. 'em',
  38. 'Logger_Shlink',
  39. 'config.url_shortener.visits_webhooks',
  40. 'config.url_shortener.domain',
  41. Options\AppOptions::class,
  42. ],
  43. ],
  44. ];