authserver/homestead/src/ResumeCommand.php
changeset 8 5a0cbbe0922a
equal deleted inserted replaced
7:1a3fa80225b2 8:5a0cbbe0922a
       
     1 <?php namespace Laravel\Homestead;
       
     2 
       
     3 use Symfony\Component\Process\Process;
       
     4 use Symfony\Component\Console\Command\Command;
       
     5 use Symfony\Component\Console\Input\InputInterface;
       
     6 use Symfony\Component\Console\Output\OutputInterface;
       
     7 
       
     8 class ResumeCommand extends Command {
       
     9 
       
    10 	/**
       
    11 	 * Configure the command options.
       
    12 	 *
       
    13 	 * @return void
       
    14 	 */
       
    15 	protected function configure()
       
    16 	{
       
    17 		$this->setName('resume')
       
    18                   ->setDescription('Resume the suspended Homestead machine');
       
    19 	}
       
    20 
       
    21 	/**
       
    22 	 * Execute the command.
       
    23 	 *
       
    24 	 * @param  \Symfony\Component\Console\Input\InputInterface  $input
       
    25 	 * @param  \Symfony\Component\Console\Output\OutputInterface  $output
       
    26 	 * @return void
       
    27 	 */
       
    28 	public function execute(InputInterface $input, OutputInterface $output)
       
    29 	{
       
    30 		$process = new Process('vagrant resume', realpath(__DIR__.'/../'), array_merge($_SERVER, $_ENV), null, null);
       
    31 
       
    32 		$process->run(function($type, $line) use ($output)
       
    33 		{
       
    34 			$output->write($line);
       
    35 		});
       
    36 	}
       
    37 
       
    38 }