diff options
author | Phil Burton <phil@d3r.com> | 2017-08-21 18:58:05 +0100 |
---|---|---|
committer | Phil Burton <phil@d3r.com> | 2017-08-21 18:58:05 +0100 |
commit | 31ac8bccdae86eeb150cb396c44ee88427120e3e (patch) | |
tree | 29526c559aab90170b036a1801a17785c2a9479c /src/Script/Command/Site.php | |
parent | 0ed82a2c6ffd8e981d9dd388306379941ecb5720 (diff) |
wip
Diffstat (limited to 'src/Script/Command/Site.php')
-rw-r--r-- | src/Script/Command/Site.php | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/src/Script/Command/Site.php b/src/Script/Command/Site.php deleted file mode 100644 index 8a6a8e7..0000000 --- a/src/Script/Command/Site.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -namespace App\Script\Command; - -use Symfony\Component\Console\Command\Command as SyCommand; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Helper\ProgressBar; -use App\Filesystem\CreateFile; -use App\Filesystem\CreateDirectory; - -class Site extends SyCommand -{ - protected function configure() - { - $this - ->addArgument('name', InputArgument::REQUIRED, 'The name of the new site.'); - - $this - ->addArgument('domain', InputArgument::REQUIRED, 'The domain name of the new site.'); - - $this - ->setName('site:create') - ->setDescription('Create a new site.') - ->setHelp('This command allows you to create a new site.') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $taskCount = 6; - $output->writeln( - 'Creating new site with domain: ' - . $input->getArgument('domain') - . ' and name: ' - . $input->getArgument('name') - ); - - $progressBar = new ProgressBar($output, $taskCount); - $progressBar->setFormatDefinition('custom', ' %current%/%max% -- %message%'); - $progressBar->setFormat('custom'); - $progressBar->setMessage('Starting...'); - $progressBar->start(); - $progressBar->setMessage('Running pre-flight checks'); - - $progressBar->advance(); - try { - $create = new \App\Filesystem\CreateFile(DIPPER_ROOT . '/foo.test'); - $create = new \App\Filesystem\CreateDirectory(DIPPER_ROOT); - sleep(1); - } catch (\Exception $e) { - $output->writeln('Error with pre-flight checks'); - $output->writeln($e->getMessage()); - exit; - } - - $progressBar->advance(); - $progressBar->setMessage('Creating directory structure'); - sleep(1); - - $progressBar->advance(); - $progressBar->setMessage('Creating nginx config'); - sleep(1); - - $progressBar->advance(); - $progressBar->setMessage('Creating default index.php'); - sleep(1); - - $progressBar->advance(); - $progressBar->setMessage('Creating nginx config'); - sleep(1); - - $progressBar->advance(); - $progressBar->finish(); - - $output->writeln(''); - $output->writeln('Complete'); - } -} |