public function initTool()
{
$kernel = $this->container->get('kernel');
$this->console = new Application($kernel);
$this->console->setAutoExit(false);
$this->console->setCatchExceptions(false);
$this->console->add(new GenerateEntitiesDoctrineCommand());
$this->console->add(new ConvertMappingDoctrineCommand());
$self = $this;
$this->console->register('rm')->setDefinition([new InputArgument('path', InputArgument::REQUIRED)])->setCode(function (InputInterface $input, OutputInterface $output) use($self) {
$path = $input->getArgument('path');
$cmd = 'rm -rf ' . $path . ' 2>&1';
$output->writeln(sprintf('<comment>%s</comment>', $cmd));
$self->runCmd($cmd, $output);
});
$this->console->register('mkdir')->setDefinition([new InputArgument('path', InputArgument::REQUIRED)])->setCode(function (InputInterface $input, OutputInterface $output) use($self) {
$path = $input->getArgument('path');
$cmd = 'mkdir ' . $path . ' 2>&1';
$output->writeln(sprintf('<comment>%s</comment>', $cmd));
$self->runCmd($cmd, $output);
});
}