You are here

public function PhpFileLoader::load in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/routing/Loader/PhpFileLoader.php \Symfony\Component\Routing\Loader\PhpFileLoader::load()
  2. 8 vendor/symfony/translation/Loader/PhpFileLoader.php \Symfony\Component\Translation\Loader\PhpFileLoader::load()
  3. 8 vendor/symfony/dependency-injection/Loader/PhpFileLoader.php \Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Loader/PhpFileLoader.php \Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load()

File

vendor/symfony/dependency-injection/Loader/PhpFileLoader.php, line 29

Class

PhpFileLoader
PhpFileLoader loads service definitions from a PHP file.

Namespace

Symfony\Component\DependencyInjection\Loader

Code

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

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