Author: Johannes M. Schmitt (schmittjoh@gmail.com)
 protected function process(ContainerBuilder $container)
 {
     $pass = new RepeatedPass(array(new AnalyzeServiceReferencesPass()));
     $pass->setCompiler($compiler = new Compiler());
     $pass->process($container);
     return $compiler->getServiceReferenceGraph();
 }
 protected function process(ContainerBuilder $container)
 {
     $compiler = new Compiler();
     $passConfig = $compiler->getPassConfig();
     $passConfig->setOptimizationPasses(array(new AnalyzeServiceReferencesPass(true), new CheckCircularReferencesPass()));
     $passConfig->setRemovingPasses(array());
     $compiler->compile($container);
 }
Beispiel #3
0
 /**
  * Compiles the container.
  *
  * This method passes the container to compiler
  * passes whose job is to manipulate and optimize
  * the container.
  *
  * The main compiler passes roughly do four things:
  *
  *  * The extension configurations are merged;
  *  * Parameter values are resolved;
  *  * The parameter bag is frozen;
  *  * Extension loading is disabled.
  *
  * @api
  */
 public function compile()
 {
     if (null === $this->compiler) {
         $this->compiler = new Compiler();
     }
     foreach ($this->compiler->getPassConfig()->getPasses() as $pass) {
         $this->addObjectResource($pass);
     }
     $this->compiler->compile($this);
     $this->extensionConfigs = array();
     parent::compile();
 }
 /**
  * Compiles the container.
  *
  * This method passes the container to compiler
  * passes whose job is to manipulate and optimize
  * the container.
  *
  * The main compiler passes roughly do four things:
  *
  *  * The extension configurations are merged;
  *  * Parameter values are resolved;
  *  * The parameter bag is frozen;
  *  * Extension loading is disabled.
  *
  * @api
  */
 public function compile()
 {
     if (null === $this->compiler) {
         $this->compiler = new Compiler();
     }
     if ($this->trackResources) {
         foreach ($this->compiler->getPassConfig()->getPasses() as $pass) {
             $this->addObjectResource($pass);
         }
         foreach ($this->definitions as $definition) {
             if ($definition->isLazy() && ($class = $definition->getClass()) && class_exists($class)) {
                 $this->addClassResource(new \ReflectionClass($class));
             }
         }
     }
     $this->compiler->compile($this);
     $this->extensionConfigs = array();
     parent::compile();
 }
 public function setCompiler(Compiler $compiler)
 {
     $this->graph = $compiler->getServiceReferenceGraph();
 }