示例#1
0
 /**
  * Execute the command.
  *
  * @param  \Symfony\Component\Console\Input\InputInterface  $input
  * @param  \Symfony\Component\Console\Output\OutputInterface  $output
  * @return void
  */
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $file = homestead_path() . '/Homestead.yaml';
     $parse = new Parser();
     $value = $parse->parse(file_get_contents($file));
     $value['sites'][] = ['map' => $input->getArgument('map'), 'to' => $input->getArgument('to')];
     $dumper = new Dumper();
     $yaml = $dumper->dump($value, 3);
     file_put_contents($file, $yaml);
     file_put_contents('/etc/hosts', '192.168.10.10  ' . $input->getArgument('map'), FILE_APPEND);
     $provision = new ProvisionCommand();
     $provision->execute($input, $output);
 }
 /**
  * {@inheritDoc}
  */
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $this->execMake($output);
     parent::execute($input, $output);
 }