BundleInterface.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  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 Symfony\Component\HttpKernel\Bundle;
  11. use Symfony\Component\DependencyInjection\ContainerBuilder;
  12. use Symfony\Component\DependencyInjection\ContainerInterface;
  13. use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
  14. /**
  15. * BundleInterface.
  16. *
  17. * @author Fabien Potencier <fabien@symfony.com>
  18. */
  19. interface BundleInterface
  20. {
  21. /**
  22. * Boots the Bundle.
  23. */
  24. public function boot(): void;
  25. /**
  26. * Shutdowns the Bundle.
  27. */
  28. public function shutdown(): void;
  29. /**
  30. * Builds the bundle.
  31. *
  32. * It is only ever called once when the cache is empty.
  33. */
  34. public function build(ContainerBuilder $container): void;
  35. /**
  36. * Returns the container extension that should be implicitly loaded.
  37. */
  38. public function getContainerExtension(): ?ExtensionInterface;
  39. /**
  40. * Returns the bundle name (the class short name).
  41. */
  42. public function getName(): string;
  43. /**
  44. * Gets the Bundle namespace.
  45. */
  46. public function getNamespace(): string;
  47. /**
  48. * Gets the Bundle directory path.
  49. *
  50. * The path should always be returned as a Unix path (with /).
  51. */
  52. public function getPath(): string;
  53. public function setContainer(?ContainerInterface $container): void;
  54. }