You are here

private function XmlFileLoader::parseImports in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Loader/XmlFileLoader.php \Symfony\Component\DependencyInjection\Loader\XmlFileLoader::parseImports()

Parses imports.

Parameters

\DOMDocument $xml:

string $file:

1 call to XmlFileLoader::parseImports()
XmlFileLoader::load in vendor/symfony/dependency-injection/Loader/XmlFileLoader.php

File

vendor/symfony/dependency-injection/Loader/XmlFileLoader.php, line 87

Class

XmlFileLoader
XmlFileLoader loads XML files service definitions.

Namespace

Symfony\Component\DependencyInjection\Loader

Code

private function parseImports(\DOMDocument $xml, $file) {
  $xpath = new \DOMXPath($xml);
  $xpath
    ->registerNamespace('container', self::NS);
  if (false === ($imports = $xpath
    ->query('//container:imports/container:import'))) {
    return;
  }
  foreach ($imports as $import) {
    $this
      ->setCurrentDir(dirname($file));
    $this
      ->import($import
      ->getAttribute('resource'), null, (bool) XmlUtils::phpize($import
      ->getAttribute('ignore-errors')), $file);
  }
}