You are here

public function PhpFileLoader::load in Service Container 7.2

Same name and namespace in other branches
  1. 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php \Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load()

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/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;
}