| author | durandn |
| Thu, 10 Sep 2015 15:47:00 +0200 | |
| changeset 120 | 93af8545dd96 |
| parent 8 | 5a0cbbe0922a |
| permissions | -rw-r--r-- |
<?php namespace Laravel\Homestead; use Symfony\Component\Process\Process; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class HaltCommand extends Command { /** * Configure the command options. * * @return void */ protected function configure() { $this->setName('halt') ->setDescription('Halt the Homestead machine'); } /** * 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) { $process = new Process('vagrant halt', realpath(__DIR__.'/../'), array_merge($_SERVER, $_ENV), null, null); $process->run(function($type, $line) use ($output) { $output->write($line); }); } }