public function PhpFileLoader::load

Same name in this branch

Loads a PHP file.

Parameters

mixed $file The resource:

string $type The resource type:

File

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

Class

PhpFileLoader
PhpFileLoader loads service definitions from a PHP file.

Namespace

Symfony\Component\DependencyInjection\Loader

Code

public function load($file, $type = null) {

  // the container and loader variables are exposed to the included file below
  $container = $this->container;
  $loader = $this;
  $path = $this->locator
    ->locate($file);
  $this
    ->setCurrentDir(dirname($path));
  $this->container
    ->addResource(new FileResource($path));
  include $path;
}