Exemple #1
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->write('Rebuild DIC...');
     $this->rebuild->rebuildDIC(true);
     $event = new ClearCacheEvent();
     $this->dispatchEvent($event);
     $output->writeln('<info>done</info>');
 }
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $dic = $this->rebuild->rebuildDIC(false);
     $dumper = new GraphvizDumper($dic);
     $content = $dumper->dump();
     file_put_contents(ROOT . 'cache/dic.gv', $content);
     exec('dot -Tpng cache/dic.gv -o cache/graph.png; rm cache/dic.gv');
     $output->writeln('PNG: <info>cache/graph.png</info>');
     $output->writeln('GV:  <info>cache/dic.gv</info>');
 }
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->container = $this->rebuild->rebuildDIC(false);
     $table = new Table($output);
     $table->setHeaders(['service-id', 'visibility']);
     $ids = $this->container->getServiceIds();
     sort($ids);
     $visibility = $input->getArgument('visibility');
     foreach ($ids as $id) {
         if ($this->container->hasDefinition($id)) {
             $this->addDefinition($id, $table, $visibility);
         }
     }
     $table->render();
 }
Exemple #4
0
 private function initContainerBuilder()
 {
     if ($this->container !== null) {
         return;
     }
     $this->container = $this->rebuild->rebuildDIC(false);
 }
Exemple #5
0
 /**
  * @return Container
  */
 public function boot() : Container
 {
     $fileName = ROOT . 'cache/dic.php';
     /** @var Container $dic */
     if (is_file($fileName)) {
         $className = file_get_contents(ROOT . 'cache/dic.txt');
         if (!class_exists($className, false)) {
             include $fileName;
         }
         $dic = new $className();
     } else {
         $rebuild = new Rebuild();
         $dic = $rebuild->rebuildDIC(true);
     }
     $dic->get('monolog.ErrorHandler');
     return $dic;
 }
 private function initContainerBuilder()
 {
     $this->containerBuilder = $this->rebuild->rebuildDIC(false);
 }