public function Extension::getConfiguration in Service Container 7
Same name and namespace in other branches
- 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Extension/Extension.php \Symfony\Component\DependencyInjection\Extension\Extension::getConfiguration()
Returns extension configuration.
Parameters
array $config An array of configuration values:
ContainerBuilder $container A ContainerBuilder instance:
Return value
ConfigurationInterface|null The configuration or null
Overrides ConfigurationExtensionInterface::getConfiguration
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Extension/ Extension.php, line 83
Class
- Extension
- Provides useful features shared by many extensions.
Namespace
Symfony\Component\DependencyInjection\ExtensionCode
public function getConfiguration(array $config, ContainerBuilder $container) {
$reflected = new \ReflectionClass($this);
$namespace = $reflected
->getNamespaceName();
$class = $namespace . '\\Configuration';
if (class_exists($class)) {
$r = new \ReflectionClass($class);
$container
->addResource(new FileResource($r
->getFileName()));
if (!method_exists($class, '__construct')) {
$configuration = new $class();
return $configuration;
}
}
}