BundleInterface.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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\ContainerAwareInterface;
  12. use Symfony\Component\DependencyInjection\ContainerBuilder;
  13. use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
  14. /**
  15. * BundleInterface.
  16. *
  17. * @author Fabien Potencier <fabien@symfony.com>
  18. *
  19. * @api
  20. */
  21. interface BundleInterface extends ContainerAwareInterface
  22. {
  23. /**
  24. * Boots the Bundle.
  25. *
  26. * @api
  27. */
  28. public function boot();
  29. /**
  30. * Shutdowns the Bundle.
  31. *
  32. * @api
  33. */
  34. public function shutdown();
  35. /**
  36. * Builds the bundle.
  37. *
  38. * It is only ever called once when the cache is empty.
  39. *
  40. * @param ContainerBuilder $container A ContainerBuilder instance
  41. *
  42. * @api
  43. */
  44. public function build(ContainerBuilder $container);
  45. /**
  46. * Returns the container extension that should be implicitly loaded.
  47. *
  48. * @return ExtensionInterface|null The default extension or null if there is none
  49. *
  50. * @api
  51. */
  52. public function getContainerExtension();
  53. /**
  54. * Returns the bundle name that this bundle overrides.
  55. *
  56. * Despite its name, this method does not imply any parent/child relationship
  57. * between the bundles, just a way to extend and override an existing
  58. * bundle.
  59. *
  60. * @return string The Bundle name it overrides or null if no parent
  61. *
  62. * @api
  63. */
  64. public function getParent();
  65. /**
  66. * Returns the bundle name (the class short name).
  67. *
  68. * @return string The Bundle name
  69. *
  70. * @api
  71. */
  72. public function getName();
  73. /**
  74. * Gets the Bundle namespace.
  75. *
  76. * @return string The Bundle namespace
  77. *
  78. * @api
  79. */
  80. public function getNamespace();
  81. /**
  82. * Gets the Bundle directory path.
  83. *
  84. * The path should always be returned as a Unix path (with /).
  85. *
  86. * @return string The Bundle absolute path
  87. *
  88. * @api
  89. */
  90. public function getPath();
  91. }