vendor/presta/sitemap-bundle/src/PrestaSitemapBundle.php line 26

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of the PrestaSitemapBundle package.
  4. *
  5. * (c) PrestaConcept <https://prestaconcept.net>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Presta\SitemapBundle;
  11. use Presta\SitemapBundle\DependencyInjection\Compiler\EventAliasMappingPass;
  12. use Presta\SitemapBundle\Event\SitemapAddUrlEvent;
  13. use Presta\SitemapBundle\Event\SitemapPopulateEvent;
  14. use Symfony\Component\DependencyInjection\ContainerBuilder;
  15. use Symfony\Component\EventDispatcher\DependencyInjection\AddEventAliasesPass;
  16. use Symfony\Component\HttpKernel\Bundle\Bundle;
  17. /**
  18. * Render/Dump Symfony application sitemap in respect of sitemap protocol.
  19. *
  20. * https://www.sitemaps.org/
  21. */
  22. class PrestaSitemapBundle extends Bundle
  23. {
  24. /**
  25. * @inheritdoc
  26. *
  27. * @return void
  28. */
  29. public function build(ContainerBuilder $container)
  30. {
  31. parent::build($container);
  32. $container->addCompilerPass(new AddEventAliasesPass([
  33. SitemapAddUrlEvent::class => SitemapAddUrlEvent::NAME,
  34. SitemapPopulateEvent::class => SitemapPopulateEvent::ON_SITEMAP_POPULATE,
  35. ]));
  36. }
  37. /**
  38. * @inheritDoc
  39. */
  40. public function getPath(): string
  41. {
  42. return \dirname(__DIR__);
  43. }
  44. }