dependencies.config.php 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. declare(strict_types=1);
  3. namespace Shlinkio\Shlink\Core;
  4. use Doctrine\Common\Cache\Cache;
  5. use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
  6. use Mezzio\Router\RouterInterface;
  7. use Mezzio\Template\TemplateRendererInterface;
  8. use Psr\EventDispatcher\EventDispatcherInterface;
  9. use Shlinkio\Shlink\Core\ErrorHandler;
  10. use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions;
  11. return [
  12. 'dependencies' => [
  13. 'factories' => [
  14. ErrorHandler\NotFoundRedirectHandler::class => ConfigAbstractFactory::class,
  15. ErrorHandler\NotFoundTemplateHandler::class => ConfigAbstractFactory::class,
  16. Options\AppOptions::class => ConfigAbstractFactory::class,
  17. Options\DeleteShortUrlsOptions::class => ConfigAbstractFactory::class,
  18. Options\NotFoundRedirectOptions::class => ConfigAbstractFactory::class,
  19. Options\UrlShortenerOptions::class => ConfigAbstractFactory::class,
  20. Service\UrlShortener::class => ConfigAbstractFactory::class,
  21. Service\VisitsTracker::class => ConfigAbstractFactory::class,
  22. Service\ShortUrlService::class => ConfigAbstractFactory::class,
  23. Service\VisitService::class => ConfigAbstractFactory::class,
  24. Service\Tag\TagService::class => ConfigAbstractFactory::class,
  25. Service\ShortUrl\DeleteShortUrlService::class => ConfigAbstractFactory::class,
  26. Util\UrlValidator::class => ConfigAbstractFactory::class,
  27. Action\RedirectAction::class => ConfigAbstractFactory::class,
  28. Action\PixelAction::class => ConfigAbstractFactory::class,
  29. Action\QrCodeAction::class => ConfigAbstractFactory::class,
  30. Middleware\QrCodeCacheMiddleware::class => ConfigAbstractFactory::class,
  31. ],
  32. ],
  33. ConfigAbstractFactory::class => [
  34. ErrorHandler\NotFoundRedirectHandler::class => [NotFoundRedirectOptions::class, 'config.router.base_path'],
  35. ErrorHandler\NotFoundTemplateHandler::class => [TemplateRendererInterface::class],
  36. Options\AppOptions::class => ['config.app_options'],
  37. Options\DeleteShortUrlsOptions::class => ['config.delete_short_urls'],
  38. Options\NotFoundRedirectOptions::class => ['config.not_found_redirects'],
  39. Options\UrlShortenerOptions::class => ['config.url_shortener'],
  40. Service\UrlShortener::class => [Util\UrlValidator::class, 'em', Options\UrlShortenerOptions::class],
  41. Service\VisitsTracker::class => ['em', EventDispatcherInterface::class],
  42. Service\ShortUrlService::class => ['em'],
  43. Service\VisitService::class => ['em'],
  44. Service\Tag\TagService::class => ['em'],
  45. Service\ShortUrl\DeleteShortUrlService::class => ['em', Options\DeleteShortUrlsOptions::class],
  46. Util\UrlValidator::class => ['httpClient'],
  47. Action\RedirectAction::class => [
  48. Service\UrlShortener::class,
  49. Service\VisitsTracker::class,
  50. Options\AppOptions::class,
  51. 'Logger_Shlink',
  52. ],
  53. Action\PixelAction::class => [
  54. Service\UrlShortener::class,
  55. Service\VisitsTracker::class,
  56. Options\AppOptions::class,
  57. 'Logger_Shlink',
  58. ],
  59. Action\QrCodeAction::class => [RouterInterface::class, Service\UrlShortener::class, 'Logger_Shlink'],
  60. Middleware\QrCodeCacheMiddleware::class => [Cache::class],
  61. ],
  62. ];