BundleInterface.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. * @return void
  25. */
  26. public function boot();
  27. /**
  28. * Shutdowns the Bundle.
  29. *
  30. * @return void
  31. */
  32. public function shutdown();
  33. /**
  34. * Builds the bundle.
  35. *
  36. * It is only ever called once when the cache is empty.
  37. *
  38. * @return void
  39. */
  40. public function build(ContainerBuilder $container);
  41. /**
  42. * Returns the container extension that should be implicitly loaded.
  43. */
  44. public function getContainerExtension(): ?ExtensionInterface;
  45. /**
  46. * Returns the bundle name (the class short name).
  47. */
  48. public function getName(): string;
  49. /**
  50. * Gets the Bundle namespace.
  51. */
  52. public function getNamespace(): string;
  53. /**
  54. * Gets the Bundle directory path.
  55. *
  56. * The path should always be returned as a Unix path (with /).
  57. */
  58. public function getPath(): string;
  59. /**
  60. * @return void
  61. */
  62. public function setContainer(?ContainerInterface $container);
  63. }