@@ 12-34 (lines=23) @@ | ||
9 | * Class DestroyCommand |
|
10 | * @package Magestead\Command\VM |
|
11 | */ |
|
12 | class DestroyCommand extends Command |
|
13 | { |
|
14 | /** |
|
15 | * @var |
|
16 | */ |
|
17 | protected $_projectPath; |
|
18 | ||
19 | protected function configure() |
|
20 | { |
|
21 | $this->_projectPath = getcwd(); |
|
22 | ||
23 | $this->setName("vm:destroy"); |
|
24 | $this->setDescription("Destroy your development machine"); |
|
25 | } |
|
26 | ||
27 | /** |
|
28 | * @param InputInterface $input |
|
29 | * @param OutputInterface $output |
|
30 | * @return ProcessCommand |
|
31 | */ |
|
32 | protected function execute(InputInterface $input, OutputInterface $output) |
|
33 | { |
|
34 | $output->writeln('<info>Destroying your development environment</info>'); |
|
35 | return new ProcessCommand('vagrant destroy --force', $this->_projectPath, $output); |
|
36 | } |
|
37 | } |
@@ 12-34 (lines=23) @@ | ||
9 | * Class HaltCommand |
|
10 | * @package Magestead\Command\VM |
|
11 | */ |
|
12 | class HaltCommand extends Command |
|
13 | { |
|
14 | protected $_projectPath; |
|
15 | ||
16 | protected function configure() |
|
17 | { |
|
18 | $this->_projectPath = getcwd(); |
|
19 | ||
20 | $this->setName("vm:halt"); |
|
21 | $this->setDescription("Halt your development machine"); |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * @param InputInterface $input |
|
26 | * @param OutputInterface $output |
|
27 | * @return ProcessCommand |
|
28 | */ |
|
29 | protected function execute(InputInterface $input, OutputInterface $output) |
|
30 | { |
|
31 | $output->writeln('<info>Halting your development environment</info>'); |
|
32 | return new ProcessCommand('vagrant halt', $this->_projectPath, $output); |
|
33 | } |
|
34 | } |
|
35 |
@@ 12-34 (lines=23) @@ | ||
9 | * Class ResumeCommand |
|
10 | * @package Magestead\Command\VM |
|
11 | */ |
|
12 | class ResumeCommand extends Command |
|
13 | { |
|
14 | protected $_projectPath; |
|
15 | ||
16 | protected function configure() |
|
17 | { |
|
18 | $this->_projectPath = getcwd(); |
|
19 | ||
20 | $this->setName("vm:resume"); |
|
21 | $this->setDescription("Resume your suspended development machine"); |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * @param InputInterface $input |
|
26 | * @param OutputInterface $output |
|
27 | * @return ProcessCommand |
|
28 | */ |
|
29 | protected function execute(InputInterface $input, OutputInterface $output) |
|
30 | { |
|
31 | $output->writeln('<info>Resuming your development environment</info>'); |
|
32 | return new ProcessCommand('vagrant resume', $this->_projectPath, $output); |
|
33 | } |
|
34 | } |
|
35 |
@@ 12-34 (lines=23) @@ | ||
9 | * Class StatusCommand |
|
10 | * @package Magestead\Command\VM |
|
11 | */ |
|
12 | class StatusCommand extends Command |
|
13 | { |
|
14 | protected $_projectPath; |
|
15 | ||
16 | protected function configure() |
|
17 | { |
|
18 | $this->_projectPath = getcwd(); |
|
19 | ||
20 | $this->setName("vm:status"); |
|
21 | $this->setDescription("Get the status of your development machine"); |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * @param InputInterface $input |
|
26 | * @param OutputInterface $output |
|
27 | * @return ProcessCommand |
|
28 | */ |
|
29 | protected function execute(InputInterface $input, OutputInterface $output) |
|
30 | { |
|
31 | $output->writeln('<info>Getting machine status</info>'); |
|
32 | return new ProcessCommand('vagrant status', $this->_projectPath, $output); |
|
33 | } |
|
34 | } |
|
35 |
@@ 12-34 (lines=23) @@ | ||
9 | * Class SuspendCommand |
|
10 | * @package Magestead\Command\VM |
|
11 | */ |
|
12 | class SuspendCommand extends Command |
|
13 | { |
|
14 | protected $_projectPath; |
|
15 | ||
16 | protected function configure() |
|
17 | { |
|
18 | $this->_projectPath = getcwd(); |
|
19 | ||
20 | $this->setName("vm:suspend"); |
|
21 | $this->setDescription("Suspend your development machine"); |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * @param InputInterface $input |
|
26 | * @param OutputInterface $output |
|
27 | * @return ProcessCommand |
|
28 | */ |
|
29 | protected function execute(InputInterface $input, OutputInterface $output) |
|
30 | { |
|
31 | $output->writeln('<info>Suspending your development machine</info>'); |
|
32 | return new ProcessCommand('vagrant suspend', $this->_projectPath, $output); |
|
33 | } |
|
34 | } |
|
35 |
@@ 12-34 (lines=23) @@ | ||
9 | * Class UpCommand |
|
10 | * @package Magestead\Command\VM |
|
11 | */ |
|
12 | class UpCommand extends Command |
|
13 | { |
|
14 | protected $_projectPath; |
|
15 | ||
16 | protected function configure() |
|
17 | { |
|
18 | $this->_projectPath = getcwd(); |
|
19 | ||
20 | $this->setName("vm:up"); |
|
21 | $this->setDescription("Spin up your development machine"); |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * @param InputInterface $input |
|
26 | * @param OutputInterface $output |
|
27 | * @return ProcessCommand |
|
28 | */ |
|
29 | protected function execute(InputInterface $input, OutputInterface $output) |
|
30 | { |
|
31 | $output->writeln('<info>Spinning up your development machine</info>'); |
|
32 | return new ProcessCommand('vagrant up', $this->_projectPath, $output); |
|
33 | } |
|
34 | } |
|
35 |
@@ 12-39 (lines=28) @@ | ||
9 | * Class UpdateCommand |
|
10 | * @package Magestead\Command |
|
11 | */ |
|
12 | class UpdateCommand extends Command |
|
13 | { |
|
14 | private $projectPath; |
|
15 | ||
16 | /** |
|
17 | * Configure the command and description |
|
18 | */ |
|
19 | public function configure() |
|
20 | { |
|
21 | $this->projectPath = getcwd(); |
|
22 | ||
23 | $this->setName("self-update"); |
|
24 | $this->setDescription("Check for new updates for Magestead CLI"); |
|
25 | } |
|
26 | ||
27 | /** |
|
28 | * Execute a global composer update for the package |
|
29 | * |
|
30 | * @param InputInterface $input |
|
31 | * @param OutputInterface $output |
|
32 | * @return ProcessCommand |
|
33 | */ |
|
34 | protected function execute(InputInterface $input, OutputInterface $output) |
|
35 | { |
|
36 | $output->writeln('<info>Checking for Updates</info>'); |
|
37 | return new ProcessCommand('composer global update richdynamix/magestead', $this->projectPath, $output); |
|
38 | } |
|
39 | } |