Skip to content

Commit

Permalink
[DependencyInjection] added the extension files in the list of loaded…
Browse files Browse the repository at this point in the history
… resources
  • Loading branch information
fabpot committed Feb 12, 2010
1 parent 8e81bbb commit 5d85297
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ protected function loadFromExtensions(BuilderConfiguration $configuration, $xml)
$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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ protected function resolveServices($value)

protected function loadFromExtensions(BuilderConfiguration $configuration, $content)
{
foreach ($content as $key => $config)
foreach ($content as $key => $values)
{
if (in_array($key, array('imports', 'parameters', 'services')))
{
Expand All @@ -262,12 +262,17 @@ protected function loadFromExtensions(BuilderConfiguration $configuration, $cont

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);
}
}
}

0 comments on commit 5d85297

Please sign in to comment.