Bez popisu

ConfigurableExtension.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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\DependencyInjection;
  11. use Symfony\Component\DependencyInjection\ContainerBuilder;
  12. /**
  13. * This extension sub-class provides first-class integration with the
  14. * Config/Definition Component.
  15. *
  16. * You can use this as base class if
  17. *
  18. * a) you use the Config/Definition component for configuration,
  19. * b) your configuration class is named "Configuration", and
  20. * c) the configuration class resides in the DependencyInjection sub-folder.
  21. *
  22. * @author Johannes M. Schmitt <schmittjoh@gmail.com>
  23. */
  24. abstract class ConfigurableExtension extends Extension
  25. {
  26. /**
  27. * {@inheritdoc}
  28. */
  29. final public function load(array $configs, ContainerBuilder $container)
  30. {
  31. $this->loadInternal($this->processConfiguration($this->getConfiguration($configs, $container), $configs), $container);
  32. }
  33. /**
  34. * Configures the passed container according to the merged configuration.
  35. */
  36. abstract protected function loadInternal(array $mergedConfig, ContainerBuilder $container);
  37. }