/** * {@inheritdoc} */ public function initialize(KernelInterface $kernel) { $this->container = $kernel->getContainer(); $this->serviceLocator = $kernel->getServiceLocator(); $env = $kernel->getEnvironmentManager()->getEnvInstance(); $resolver = $this->container->getParameterBag()->getResolver(); $configs = (array) $env->registerConfigurations(); $configs = $this->getResource()->process(new FileLoader(), $configs); $this->loadParametersFromConfig($configs); $this->loadServicesFromConfig($configs); // Append configuration by extension foreach ($resolver->resolveValue($configs) as $alias => $config) { if (!$this->getExtension()->has($alias)) { throw new RuntimeException(sprintf('Extension with alias "%s" not found.', $alias)); } $extension = $this->getExtension()->get($alias); $this->getConfiguration()->prepend($extension->getConfigDefinition(), array($config)); } }
/** * Initialize process process. * * @param KernelInterface $kernel */ public function initialize(KernelInterface $kernel) { $serviceLocator = $kernel->getServiceLocator(); $serviceLocator->getExtension()->load($serviceLocator->getConfiguration(), $kernel->getContainer()); }