buildFromConfiguration() 공개 정적인 메소드

public static buildFromConfiguration ( string $path ) : ContainerBuilder
$path string path to grumphp.yml
리턴 Symfony\Component\DependencyInjection\ContainerBuilder
예제 #1
0
 function it_should_load_available_tasks_from_the_service_container(ContainerBuilder $container, TaskCompilerPass $taskCompiler)
 {
     $container = ContainerFactory::buildFromConfiguration(__DIR__ . '/../../../resources/config/services.yml');
     $taskCompiler->process($container);
     $this->beConstructedWith($container);
     $this->getTasks()->shouldBeArray();
 }
예제 #2
0
 /**
  * @return \Symfony\Component\DependencyInjection\ContainerBuilder
  */
 protected function getContainer()
 {
     if ($this->container) {
         return $this->container;
     }
     // Load cli options:
     $input = new ArgvInput();
     $input->bind($this->getDefaultInputDefinition());
     $configPath = $input->getOption('config');
     // Make sure to set the full path when it is declared relative
     // This will fix some issues in windows.
     $filesystem = new Filesystem();
     if (!$filesystem->isAbsolutePath($configPath)) {
         $configPath = getcwd() . DIRECTORY_SEPARATOR . $configPath;
     }
     // Build the service container:
     $this->container = ContainerFactory::buildFromConfiguration($configPath);
     return $this->container;
 }
예제 #3
0
 /**
  * @return \Symfony\Component\DependencyInjection\ContainerBuilder
  */
 protected function getContainer()
 {
     if ($this->container) {
         return $this->container;
     }
     // Load cli options:
     $input = new ArgvInput();
     $configPath = $input->getParameterOption(['--config', '-c'], $this->getDefaultConfigPath());
     // Build the service container:
     $this->container = ContainerFactory::buildFromConfiguration($configPath);
     return $this->container;
 }