[DependencyInjection] added the extension files in the list of loaded resources

This commit is contained in:
Fabien Potencier 2010-02-12 17:44:52 +01:00
parent 8e81bbbb4e
commit 5d8529740a
2 changed files with 12 additions and 4 deletions

View File

@ -343,6 +343,9 @@ EOF
$values = static::convertDomElementToArray($node);
$config = $this->getExtension($node->namespaceURI)->load($node->localName, is_array($values) ? $values : array($values));
$r = new \ReflectionObject($this->getExtension($node->namespaceURI));
$config->addResource(new FileResource($r->getFileName()));
$configuration->merge($config);
}
}

View File

@ -253,7 +253,7 @@ class YamlFileLoader extends FileLoader
protected function loadFromExtensions(BuilderConfiguration $configuration, $content)
{
foreach ($content as $key => $config)
foreach ($content as $key => $values)
{
if (in_array($key, array('imports', 'parameters', 'services')))
{
@ -262,12 +262,17 @@ class YamlFileLoader extends FileLoader
list($namespace, $tag) = explode('.', $key);
if (!is_array($config))
if (!is_array($values))
{
$config = array();
$values = array();
}
$configuration->merge(static::getExtension($namespace)->load($tag, $config));
$config = static::getExtension($namespace)->load($tag, $values);
$r = new \ReflectionObject($this->getExtension($namespace));
$config->addResource(new FileResource($r->getFileName()));
$configuration->merge($config);
}
}
}