public function XmlFileLoader::load

Same name in this branch

Loads an XML file.

Parameters

mixed $file The resource:

string $type The resource type:

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php, line 38

Class

XmlFileLoader
XmlFileLoader loads XML files service definitions.

Namespace

Symfony\Component\DependencyInjection\Loader

Code

public function load($file, $type = null) {
  $path = $this->locator
    ->locate($file);
  $xml = $this
    ->parseFile($path);
  $xml
    ->registerXPathNamespace('container', 'http://symfony.com/schema/dic/services');
  $this->container
    ->addResource(new FileResource($path));

  // anonymous services
  $this
    ->processAnonymousServices($xml, $path);

  // imports
  $this
    ->parseImports($xml, $path);

  // parameters
  $this
    ->parseParameters($xml, $path);

  // extensions
  $this
    ->loadFromExtensions($xml);

  // services
  $this
    ->parseDefinitions($xml, $path);
}