@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function configure() |
| 19 | 19 | { |
| 20 | - $this->_projectPath = getcwd(); |
|
| 20 | + $this->_projectPath=getcwd(); |
|
| 21 | 21 | $this->setName("cache:enable"); |
| 22 | 22 | $this->setDescription("Enable cache types"); |
| 23 | 23 | $this->addArgument('type', InputArgument::OPTIONAL, '[cache code/type]'); |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $output->writeln('<info>Enabling all cache types</info>'); |
| 34 | 34 | |
| 35 | - $cacheType = $input->getArgument('type'); |
|
| 36 | - $command = $this->getCommand(new Config($output), $cacheType); |
|
| 37 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 35 | + $cacheType=$input->getArgument('type'); |
|
| 36 | + $command=$this->getCommand(new Config($output), $cacheType); |
|
| 37 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 38 | 38 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | protected function getCommand(Config $config, $cacheType) |
| 46 | 46 | { |
| 47 | - $type = $config->type; |
|
| 47 | + $type=$config->type; |
|
| 48 | 48 | switch ($type) { |
| 49 | 49 | case 'magento': |
| 50 | 50 | return "cd /var/www/public;../bin/n98-magerun.phar cache:enable $cacheType"; |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | protected $_config; |
| 16 | 16 | protected $_projectPath; |
| 17 | 17 | |
| 18 | - protected function configure() |
|
| 19 | - { |
|
| 18 | + protected function configure() { |
|
| 20 | 19 | $this->_projectPath = getcwd(); |
| 21 | 20 | $this->setName("cache:enable"); |
| 22 | 21 | $this->setDescription("Enable cache types"); |
@@ -28,8 +27,7 @@ discard block |
||
| 28 | 27 | * @param OutputInterface $output |
| 29 | 28 | * @return ProcessCommand |
| 30 | 29 | */ |
| 31 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 32 | - { |
|
| 30 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 33 | 31 | $output->writeln('<info>Enabling all cache types</info>'); |
| 34 | 32 | |
| 35 | 33 | $cacheType = $input->getArgument('type'); |
@@ -42,8 +40,7 @@ discard block |
||
| 42 | 40 | * @param Config $config |
| 43 | 41 | * @return bool|string |
| 44 | 42 | */ |
| 45 | - protected function getCommand(Config $config, $cacheType) |
|
| 46 | - { |
|
| 43 | + protected function getCommand(Config $config, $cacheType) { |
|
| 47 | 44 | $type = $config->type; |
| 48 | 45 | switch ($type) { |
| 49 | 46 | case 'magento': |
@@ -53,6 +53,6 @@ |
||
| 53 | 53 | return "cd /var/www/public;bin/magento cache:enable $cacheType"; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return false; |
|
| 56 | + return FALSE; |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function configure() |
| 19 | 19 | { |
| 20 | - $this->_projectPath = getcwd(); |
|
| 20 | + $this->_projectPath=getcwd(); |
|
| 21 | 21 | $this->setName("cache:flush"); |
| 22 | 22 | $this->setDescription("Flushes cache storage used by cache types"); |
| 23 | 23 | $this->addArgument('type', InputArgument::OPTIONAL, '[cache code/type]'); |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $output->writeln('<info>Flushing cache storage</info>'); |
| 34 | 34 | |
| 35 | - $cacheType = $input->getArgument('type'); |
|
| 36 | - $command = $this->getCommand(new Config($output), $cacheType); |
|
| 37 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 35 | + $cacheType=$input->getArgument('type'); |
|
| 36 | + $command=$this->getCommand(new Config($output), $cacheType); |
|
| 37 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 38 | 38 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | protected function getCommand(Config $config, $cacheType) |
| 46 | 46 | { |
| 47 | - $type = $config->type; |
|
| 47 | + $type=$config->type; |
|
| 48 | 48 | switch ($type) { |
| 49 | 49 | case 'magento': |
| 50 | 50 | return "cd /var/www/public;../bin/n98-magerun.phar cache:flush $cacheType"; |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | protected $_config; |
| 16 | 16 | protected $_projectPath; |
| 17 | 17 | |
| 18 | - protected function configure() |
|
| 19 | - { |
|
| 18 | + protected function configure() { |
|
| 20 | 19 | $this->_projectPath = getcwd(); |
| 21 | 20 | $this->setName("cache:flush"); |
| 22 | 21 | $this->setDescription("Flushes cache storage used by cache types"); |
@@ -28,8 +27,7 @@ discard block |
||
| 28 | 27 | * @param OutputInterface $output |
| 29 | 28 | * @return ProcessCommand |
| 30 | 29 | */ |
| 31 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 32 | - { |
|
| 30 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 33 | 31 | $output->writeln('<info>Flushing cache storage</info>'); |
| 34 | 32 | |
| 35 | 33 | $cacheType = $input->getArgument('type'); |
@@ -42,8 +40,7 @@ discard block |
||
| 42 | 40 | * @param Config $config |
| 43 | 41 | * @return bool|string |
| 44 | 42 | */ |
| 45 | - protected function getCommand(Config $config, $cacheType) |
|
| 46 | - { |
|
| 43 | + protected function getCommand(Config $config, $cacheType) { |
|
| 47 | 44 | $type = $config->type; |
| 48 | 45 | switch ($type) { |
| 49 | 46 | case 'magento': |
@@ -53,6 +53,6 @@ |
||
| 53 | 53 | return "cd /var/www/public;bin/magento cache:flush $cacheType"; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return false; |
|
| 56 | + return FALSE; |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function configure() |
| 19 | 19 | { |
| 20 | - $this->_projectPath = getcwd(); |
|
| 20 | + $this->_projectPath=getcwd(); |
|
| 21 | 21 | $this->setName("cache:clean"); |
| 22 | 22 | $this->setDescription("Cleans cache types"); |
| 23 | 23 | $this->addArgument('type', InputArgument::OPTIONAL, '[cache code/type]'); |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $output->writeln('<info>Cleaning all cache types</info>'); |
| 34 | 34 | |
| 35 | - $cacheType = $input->getArgument('type'); |
|
| 36 | - $command = $this->getCommand(new Config($output), $cacheType); |
|
| 37 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 35 | + $cacheType=$input->getArgument('type'); |
|
| 36 | + $command=$this->getCommand(new Config($output), $cacheType); |
|
| 37 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 38 | 38 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | protected function getCommand(Config $config, $cacheType) |
| 46 | 46 | { |
| 47 | - $type = $config->type; |
|
| 47 | + $type=$config->type; |
|
| 48 | 48 | switch ($type) { |
| 49 | 49 | case 'magento': |
| 50 | 50 | return "cd /var/www/public;../bin/n98-magerun.phar cache:clean $cacheType"; |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | protected $_config; |
| 16 | 16 | protected $_projectPath; |
| 17 | 17 | |
| 18 | - protected function configure() |
|
| 19 | - { |
|
| 18 | + protected function configure() { |
|
| 20 | 19 | $this->_projectPath = getcwd(); |
| 21 | 20 | $this->setName("cache:clean"); |
| 22 | 21 | $this->setDescription("Cleans cache types"); |
@@ -28,8 +27,7 @@ discard block |
||
| 28 | 27 | * @param OutputInterface $output |
| 29 | 28 | * @return ProcessCommand |
| 30 | 29 | */ |
| 31 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 32 | - { |
|
| 30 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 33 | 31 | $output->writeln('<info>Cleaning all cache types</info>'); |
| 34 | 32 | |
| 35 | 33 | $cacheType = $input->getArgument('type'); |
@@ -42,8 +40,7 @@ discard block |
||
| 42 | 40 | * @param Config $config |
| 43 | 41 | * @return bool|string |
| 44 | 42 | */ |
| 45 | - protected function getCommand(Config $config, $cacheType) |
|
| 46 | - { |
|
| 43 | + protected function getCommand(Config $config, $cacheType) { |
|
| 47 | 44 | $type = $config->type; |
| 48 | 45 | switch ($type) { |
| 49 | 46 | case 'magento': |
@@ -53,6 +53,6 @@ |
||
| 53 | 53 | return "cd /var/www/public;bin/magento cache:clean $cacheType"; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return false; |
|
| 56 | + return FALSE; |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function configure() |
| 19 | 19 | { |
| 20 | - $this->_projectPath = getcwd(); |
|
| 20 | + $this->_projectPath=getcwd(); |
|
| 21 | 21 | $this->setName("cache:disable"); |
| 22 | 22 | $this->setDescription("Disable cache types"); |
| 23 | 23 | $this->addArgument('type', InputArgument::OPTIONAL, '[cache code/type]'); |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $output->writeln('<info>Disabling all cache types</info>'); |
| 34 | 34 | |
| 35 | - $cacheType = $input->getArgument('type'); |
|
| 36 | - $command = $this->getCommand(new Config($output), $cacheType); |
|
| 37 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 35 | + $cacheType=$input->getArgument('type'); |
|
| 36 | + $command=$this->getCommand(new Config($output), $cacheType); |
|
| 37 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 38 | 38 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | protected function getCommand(Config $config, $cacheType) |
| 46 | 46 | { |
| 47 | - $type = $config->type; |
|
| 47 | + $type=$config->type; |
|
| 48 | 48 | switch ($type) { |
| 49 | 49 | case 'magento': |
| 50 | 50 | return "cd /var/www/public;../bin/n98-magerun.phar cache:disable $cacheType"; |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | protected $_config; |
| 16 | 16 | protected $_projectPath; |
| 17 | 17 | |
| 18 | - protected function configure() |
|
| 19 | - { |
|
| 18 | + protected function configure() { |
|
| 20 | 19 | $this->_projectPath = getcwd(); |
| 21 | 20 | $this->setName("cache:disable"); |
| 22 | 21 | $this->setDescription("Disable cache types"); |
@@ -28,8 +27,7 @@ discard block |
||
| 28 | 27 | * @param OutputInterface $output |
| 29 | 28 | * @return ProcessCommand |
| 30 | 29 | */ |
| 31 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 32 | - { |
|
| 30 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 33 | 31 | $output->writeln('<info>Disabling all cache types</info>'); |
| 34 | 32 | |
| 35 | 33 | $cacheType = $input->getArgument('type'); |
@@ -42,8 +40,7 @@ discard block |
||
| 42 | 40 | * @param Config $config |
| 43 | 41 | * @return bool|string |
| 44 | 42 | */ |
| 45 | - protected function getCommand(Config $config, $cacheType) |
|
| 46 | - { |
|
| 43 | + protected function getCommand(Config $config, $cacheType) { |
|
| 47 | 44 | $type = $config->type; |
| 48 | 45 | switch ($type) { |
| 49 | 46 | case 'magento': |
@@ -53,6 +53,6 @@ |
||
| 53 | 53 | return "cd /var/www/public;bin/magento cache:disable $cacheType"; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return false; |
|
| 56 | + return FALSE; |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | \ No newline at end of file |
@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | public function __construct($repoUrl, $projectPath, OutputInterface $output) |
| 19 | 19 | { |
| 20 | - $this->_output = $output; |
|
| 21 | - $this->_repoUrl = $repoUrl; |
|
| 22 | - $this->_projectPath = $projectPath; |
|
| 20 | + $this->_output=$output; |
|
| 21 | + $this->_repoUrl=$repoUrl; |
|
| 22 | + $this->_projectPath=$projectPath; |
|
| 23 | 23 | |
| 24 | 24 | $this->execute($output); |
| 25 | 25 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function init() |
| 48 | 48 | { |
| 49 | - $command = 'git init; git remote add origin ' . $this->_repoUrl; |
|
| 49 | + $command='git init; git remote add origin '.$this->_repoUrl; |
|
| 50 | 50 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
| 51 | 51 | |
| 52 | 52 | return $this; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function addFiles() |
| 61 | 61 | { |
| 62 | - $command = 'git add -A'; |
|
| 62 | + $command='git add -A'; |
|
| 63 | 63 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
| 64 | 64 | |
| 65 | 65 | return $this; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function commitFiles() |
| 74 | 74 | { |
| 75 | - $command = "git commit -m 'Initial commit'"; |
|
| 75 | + $command="git commit -m 'Initial commit'"; |
|
| 76 | 76 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
| 77 | 77 | |
| 78 | 78 | return $this; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function pushFiles() |
| 87 | 87 | { |
| 88 | - $command = "git push -u origin master"; |
|
| 88 | + $command="git push -u origin master"; |
|
| 89 | 89 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
| 90 | 90 | |
| 91 | 91 | return $this; |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | * @param $projectPath |
| 16 | 16 | * @param OutputInterface $output |
| 17 | 17 | */ |
| 18 | - public function __construct($repoUrl, $projectPath, OutputInterface $output) |
|
| 19 | - { |
|
| 18 | + public function __construct($repoUrl, $projectPath, OutputInterface $output) { |
|
| 20 | 19 | $this->_output = $output; |
| 21 | 20 | $this->_repoUrl = $repoUrl; |
| 22 | 21 | $this->_projectPath = $projectPath; |
@@ -27,8 +26,7 @@ discard block |
||
| 27 | 26 | /** |
| 28 | 27 | * @param OutputInterface $output |
| 29 | 28 | */ |
| 30 | - protected function execute(OutputInterface $output) |
|
| 31 | - { |
|
| 29 | + protected function execute(OutputInterface $output) { |
|
| 32 | 30 | $output->writeln('<info>Configuring GIT repo</info>'); |
| 33 | 31 | $this->init(); |
| 34 | 32 | |
@@ -44,8 +42,7 @@ discard block |
||
| 44 | 42 | * |
| 45 | 43 | * @return $this |
| 46 | 44 | */ |
| 47 | - public function init() |
|
| 48 | - { |
|
| 45 | + public function init() { |
|
| 49 | 46 | $command = 'git init; git remote add origin ' . $this->_repoUrl; |
| 50 | 47 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
| 51 | 48 | |
@@ -57,8 +54,7 @@ discard block |
||
| 57 | 54 | * |
| 58 | 55 | * @return $this |
| 59 | 56 | */ |
| 60 | - public function addFiles() |
|
| 61 | - { |
|
| 57 | + public function addFiles() { |
|
| 62 | 58 | $command = 'git add -A'; |
| 63 | 59 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
| 64 | 60 | |
@@ -70,8 +66,7 @@ discard block |
||
| 70 | 66 | * |
| 71 | 67 | * @return $this |
| 72 | 68 | */ |
| 73 | - public function commitFiles() |
|
| 74 | - { |
|
| 69 | + public function commitFiles() { |
|
| 75 | 70 | $command = "git commit -m 'Initial commit'"; |
| 76 | 71 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
| 77 | 72 | |
@@ -83,8 +78,7 @@ discard block |
||
| 83 | 78 | * |
| 84 | 79 | * @return $this |
| 85 | 80 | */ |
| 86 | - public function pushFiles() |
|
| 87 | - { |
|
| 81 | + public function pushFiles() { |
|
| 88 | 82 | $command = "git push -u origin master"; |
| 89 | 83 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
| 90 | 84 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function configure() |
| 20 | 20 | { |
| 21 | - $this->projectPath = getcwd(); |
|
| 21 | + $this->projectPath=getcwd(); |
|
| 22 | 22 | |
| 23 | 23 | $this->setName("self-update"); |
| 24 | 24 | $this->setDescription("Check for new updates for Magestead CLI"); |
@@ -16,8 +16,7 @@ discard block |
||
| 16 | 16 | /** |
| 17 | 17 | * Configure the command and description |
| 18 | 18 | */ |
| 19 | - public function configure() |
|
| 20 | - { |
|
| 19 | + public function configure() { |
|
| 21 | 20 | $this->projectPath = getcwd(); |
| 22 | 21 | |
| 23 | 22 | $this->setName("self-update"); |
@@ -31,8 +30,7 @@ discard block |
||
| 31 | 30 | * @param OutputInterface $output |
| 32 | 31 | * @return ProcessCommand |
| 33 | 32 | */ |
| 34 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 35 | - { |
|
| 33 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 36 | 34 | $output->writeln('<info>Checking for Updates</info>'); |
| 37 | 35 | return new ProcessCommand('composer global update richdynamix/magestead', $this->projectPath, $output); |
| 38 | 36 | } |
@@ -56,21 +56,21 @@ |
||
| 56 | 56 | public function getAllOptions() |
| 57 | 57 | { |
| 58 | 58 | return [ |
| 59 | - 'app' => $this->_app, |
|
| 60 | - 'server' => $this->_server, |
|
| 61 | - 'phpver' => $this->_phpVer, |
|
| 62 | - 'os' => $this->_os, |
|
| 63 | - 'box' => $this->_box, |
|
| 64 | - 'm2user' => $this->_m2Username, |
|
| 65 | - 'm2pass' => $this->_m2Password, |
|
| 66 | - 'repo_url' => $this->_repoUrl, |
|
| 67 | - 'ip_address' => $this->_ipAddress, |
|
| 68 | - 'cpus' => $this->_cpus, |
|
| 69 | - 'memory_limit' => $this->_memorylimit, |
|
| 70 | - 'locale' => $this->_locale, |
|
| 71 | - 'default_currency' => $this->_currency, |
|
| 72 | - 'base_url' => $this->_baseUrl, |
|
| 73 | - 'installSampleData' => $this->installSampleData, |
|
| 59 | + 'app' => $this->_app, |
|
| 60 | + 'server' => $this->_server, |
|
| 61 | + 'phpver' => $this->_phpVer, |
|
| 62 | + 'os' => $this->_os, |
|
| 63 | + 'box' => $this->_box, |
|
| 64 | + 'm2user' => $this->_m2Username, |
|
| 65 | + 'm2pass' => $this->_m2Password, |
|
| 66 | + 'repo_url' => $this->_repoUrl, |
|
| 67 | + 'ip_address' => $this->_ipAddress, |
|
| 68 | + 'cpus' => $this->_cpus, |
|
| 69 | + 'memory_limit' => $this->_memorylimit, |
|
| 70 | + 'locale' => $this->_locale, |
|
| 71 | + 'default_currency' => $this->_currency, |
|
| 72 | + 'base_url' => $this->_baseUrl, |
|
| 73 | + 'installSampleData' => $this->installSampleData, |
|
| 74 | 74 | ]; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -13,11 +13,11 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | class Options |
| 15 | 15 | { |
| 16 | - const BOX_PREFIX = 'richdynamix/magestead-'; |
|
| 16 | + const BOX_PREFIX='richdynamix/magestead-'; |
|
| 17 | 17 | |
| 18 | - protected $_app = 'magento2'; |
|
| 19 | - protected $_phpVer = '56'; |
|
| 20 | - protected $_os = 'centos65'; |
|
| 18 | + protected $_app='magento2'; |
|
| 19 | + protected $_phpVer='56'; |
|
| 20 | + protected $_os='centos65'; |
|
| 21 | 21 | protected $_server; |
| 22 | 22 | protected $_box; |
| 23 | 23 | protected $_m2Username; |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | protected $_locale; |
| 29 | 29 | protected $_currency; |
| 30 | 30 | protected $_baseUrl; |
| 31 | - protected $_repoUrl = ''; |
|
| 32 | - protected $installSampleData = false; |
|
| 31 | + protected $_repoUrl=''; |
|
| 32 | + protected $installSampleData=false; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Options constructor. |
@@ -84,14 +84,14 @@ discard block |
||
| 84 | 84 | { |
| 85 | 85 | $output->writeln('<comment>Lets configure your project\'s VM</comment>'); |
| 86 | 86 | |
| 87 | - $ipQuestion = new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
|
| 88 | - $this->_ipAddress = strtolower($helper->ask($input, $output, $ipQuestion)); |
|
| 87 | + $ipQuestion=new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
|
| 88 | + $this->_ipAddress=strtolower($helper->ask($input, $output, $ipQuestion)); |
|
| 89 | 89 | |
| 90 | - $cpuQuestion = new Question("How many CPU's would you like to use? (1): ", '1'); |
|
| 91 | - $this->_cpus = strtolower($helper->ask($input, $output, $cpuQuestion)); |
|
| 90 | + $cpuQuestion=new Question("How many CPU's would you like to use? (1): ", '1'); |
|
| 91 | + $this->_cpus=strtolower($helper->ask($input, $output, $cpuQuestion)); |
|
| 92 | 92 | |
| 93 | - $memoryQuestion = new Question("Define the VM memory limit (2048): ", '2048'); |
|
| 94 | - $this->_memorylimit = strtolower($helper->ask($input, $output, $memoryQuestion)); |
|
| 93 | + $memoryQuestion=new Question("Define the VM memory limit (2048): ", '2048'); |
|
| 94 | + $this->_memorylimit=strtolower($helper->ask($input, $output, $memoryQuestion)); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -103,22 +103,22 @@ discard block |
||
| 103 | 103 | protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) |
| 104 | 104 | { |
| 105 | 105 | $output->writeln('<comment>Lets configure your project\'s application</comment>'); |
| 106 | - $appQuestion = new ChoiceQuestion( |
|
| 106 | + $appQuestion=new ChoiceQuestion( |
|
| 107 | 107 | "Which application do you want to install?", |
| 108 | 108 | ['Magento', 'Magento2'], |
| 109 | 109 | 0 |
| 110 | 110 | ); |
| 111 | 111 | |
| 112 | - $this->_app = strtolower($helper->ask($input, $output, $appQuestion)); |
|
| 112 | + $this->_app=strtolower($helper->ask($input, $output, $appQuestion)); |
|
| 113 | 113 | |
| 114 | - $baseUrlQuestion = new Question("Enter your application's base_url ($project.dev): ", $project.'.dev'); |
|
| 115 | - $this->_baseUrl = strtolower($helper->ask($input, $output, $baseUrlQuestion)); |
|
| 114 | + $baseUrlQuestion=new Question("Enter your application's base_url ($project.dev): ", $project.'.dev'); |
|
| 115 | + $this->_baseUrl=strtolower($helper->ask($input, $output, $baseUrlQuestion)); |
|
| 116 | 116 | |
| 117 | - $currenyQuestion = new Question("Enter your application's default currency (GBP): ", 'GBP'); |
|
| 118 | - $this->_currency = $helper->ask($input, $output, $currenyQuestion); |
|
| 117 | + $currenyQuestion=new Question("Enter your application's default currency (GBP): ", 'GBP'); |
|
| 118 | + $this->_currency=$helper->ask($input, $output, $currenyQuestion); |
|
| 119 | 119 | |
| 120 | - $localeQuestion = new Question("Enter your application's default locale (en_GB): ", 'en_GB'); |
|
| 121 | - $this->_locale = $helper->ask($input, $output, $localeQuestion); |
|
| 120 | + $localeQuestion=new Question("Enter your application's default locale (en_GB): ", 'en_GB'); |
|
| 121 | + $this->_locale=$helper->ask($input, $output, $localeQuestion); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -144,18 +144,18 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
| 146 | 146 | { |
| 147 | - $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
|
| 148 | - $versioning = $helper->ask($input, $output, $versionControl); |
|
| 147 | + $versionControl=new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
|
| 148 | + $versioning=$helper->ask($input, $output, $versionControl); |
|
| 149 | 149 | if ($versioning) { |
| 150 | - $repoQuestion = new Question("Enter your full GitHub/BitBucket repo URL: ", ''); |
|
| 151 | - $this->_repoUrl = strtolower($helper->ask($input, $output, $repoQuestion)); |
|
| 150 | + $repoQuestion=new Question("Enter your full GitHub/BitBucket repo URL: ", ''); |
|
| 151 | + $this->_repoUrl=strtolower($helper->ask($input, $output, $repoQuestion)); |
|
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | protected function installSampleData($helper, InputInterface $input, OutputInterface $output) |
| 156 | 156 | { |
| 157 | - $sampleInstall = new ConfirmationQuestion("Would you like to install sample data? (no/yes) ", false); |
|
| 158 | - $this->installSampleData = $helper->ask($input, $output, $sampleInstall); |
|
| 157 | + $sampleInstall=new ConfirmationQuestion("Would you like to install sample data? (no/yes) ", false); |
|
| 158 | + $this->installSampleData=$helper->ask($input, $output, $sampleInstall); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /** |
@@ -165,11 +165,11 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | protected function askForAuth($helper, InputInterface $input, OutputInterface $output) |
| 167 | 167 | { |
| 168 | - $username = new Question("Please enter your Magento username (public key): ", ''); |
|
| 169 | - $this->_m2Username = $helper->ask($input, $output, $username); |
|
| 168 | + $username=new Question("Please enter your Magento username (public key): ", ''); |
|
| 169 | + $this->_m2Username=$helper->ask($input, $output, $username); |
|
| 170 | 170 | |
| 171 | - $password = new Question("Please enter your Magento password (private key): ", ''); |
|
| 172 | - $this->_m2Password = $helper->ask($input, $output, $password); |
|
| 171 | + $password=new Question("Please enter your Magento password (private key): ", ''); |
|
| 172 | + $this->_m2Password=$helper->ask($input, $output, $password); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | /** |
@@ -180,13 +180,13 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) |
| 182 | 182 | { |
| 183 | - $composerHome = (new Config($output))->getComposerHomeDir(); |
|
| 184 | - $authFile = $composerHome . "/auth.json"; |
|
| 183 | + $composerHome=(new Config($output))->getComposerHomeDir(); |
|
| 184 | + $authFile=$composerHome."/auth.json"; |
|
| 185 | 185 | |
| 186 | - $authObj = []; |
|
| 186 | + $authObj=[]; |
|
| 187 | 187 | if (file_exists($authFile) && is_readable($authFile)) { |
| 188 | - $authJson = file_get_contents($authFile); |
|
| 189 | - $authObj = (array)json_decode($authJson, true); |
|
| 188 | + $authJson=file_get_contents($authFile); |
|
| 189 | + $authObj=(array) json_decode($authJson, true); |
|
| 190 | 190 | |
| 191 | 191 | if (isset($authObj['http-basic']) && isset($authObj['http-basic']->{'repo.magento.com'})) { |
| 192 | 192 | return true; |
@@ -195,14 +195,14 @@ discard block |
||
| 195 | 195 | |
| 196 | 196 | $this->askForAuth($helper, $input, $output); |
| 197 | 197 | |
| 198 | - $authObj['http-basic']['repo.magento.com']['username'] = $this->_m2Username; |
|
| 199 | - $authObj['http-basic']['repo.magento.com']['password'] = $this->_m2Password; |
|
| 198 | + $authObj['http-basic']['repo.magento.com']['username']=$this->_m2Username; |
|
| 199 | + $authObj['http-basic']['repo.magento.com']['password']=$this->_m2Password; |
|
| 200 | 200 | |
| 201 | - $authJson = json_encode($authObj, JSON_PRETTY_PRINT); |
|
| 201 | + $authJson=json_encode($authObj, JSON_PRETTY_PRINT); |
|
| 202 | 202 | |
| 203 | 203 | // check writable first |
| 204 | 204 | if (!is_writable($authFile)) { |
| 205 | - $e = new AuthSavePermissionsException(); |
|
| 205 | + $e=new AuthSavePermissionsException(); |
|
| 206 | 206 | throw $e->setAuthObject($authObj); |
| 207 | 207 | } |
| 208 | 208 | |
@@ -216,13 +216,13 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | protected function setPhp($helper, InputInterface $input, OutputInterface $output) |
| 218 | 218 | { |
| 219 | - $phpVerQuestion = new ChoiceQuestion( |
|
| 219 | + $phpVerQuestion=new ChoiceQuestion( |
|
| 220 | 220 | "Which version of PHP should be installed?", |
| 221 | 221 | ['56', '70'], |
| 222 | 222 | 0 |
| 223 | 223 | ); |
| 224 | 224 | |
| 225 | - $this->_phpVer = $helper->ask($input, $output, $phpVerQuestion); |
|
| 225 | + $this->_phpVer=$helper->ask($input, $output, $phpVerQuestion); |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | /** |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | protected function setVagrantBox() |
| 232 | 232 | { |
| 233 | - $this->_box = self::BOX_PREFIX . $this->_os . "-$this->_server-php$this->_phpVer"; |
|
| 233 | + $this->_box=self::BOX_PREFIX.$this->_os."-$this->_server-php$this->_phpVer"; |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | /** |
@@ -253,13 +253,13 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | protected function setWebServer($helper, InputInterface $input, OutputInterface $output) |
| 255 | 255 | { |
| 256 | - $serverQuestion = new ChoiceQuestion( |
|
| 256 | + $serverQuestion=new ChoiceQuestion( |
|
| 257 | 257 | "Which webserver would you like?", |
| 258 | 258 | ['NGINX', 'Apache'], |
| 259 | 259 | 0 |
| 260 | 260 | ); |
| 261 | 261 | |
| 262 | - $this->_server = strtolower($helper->ask($input, $output, $serverQuestion)); |
|
| 262 | + $this->_server=strtolower($helper->ask($input, $output, $serverQuestion)); |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | /** |
@@ -269,12 +269,12 @@ discard block |
||
| 269 | 269 | */ |
| 270 | 270 | protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) |
| 271 | 271 | { |
| 272 | - $osQuestion = new ChoiceQuestion( |
|
| 272 | + $osQuestion=new ChoiceQuestion( |
|
| 273 | 273 | "Which OS would you like to install?", |
| 274 | 274 | ['CentOS 6.5', 'Ubuntu 14'], |
| 275 | 275 | 0 |
| 276 | 276 | ); |
| 277 | 277 | |
| 278 | - $this->_os = str_replace(' ', '', str_replace('.', '', strtolower($helper->ask($input, $output, $osQuestion)))); |
|
| 278 | + $this->_os=str_replace(' ', '', str_replace('.', '', strtolower($helper->ask($input, $output, $osQuestion)))); |
|
| 279 | 279 | } |
| 280 | 280 | } |
@@ -38,8 +38,7 @@ discard block |
||
| 38 | 38 | * @param OutputInterface $output |
| 39 | 39 | * @param $project |
| 40 | 40 | */ |
| 41 | - public function __construct($helper, InputInterface $input, OutputInterface $output, $project) |
|
| 42 | - { |
|
| 41 | + public function __construct($helper, InputInterface $input, OutputInterface $output, $project) { |
|
| 43 | 42 | $this->setVagrantSettings($helper, $input, $output); |
| 44 | 43 | |
| 45 | 44 | $this->setServerConfig($helper, $input, $output); |
@@ -54,8 +53,7 @@ discard block |
||
| 54 | 53 | /** |
| 55 | 54 | * @return array |
| 56 | 55 | */ |
| 57 | - public function getAllOptions() |
|
| 58 | - { |
|
| 56 | + public function getAllOptions() { |
|
| 59 | 57 | return [ |
| 60 | 58 | 'app' => $this->_app, |
| 61 | 59 | 'server' => $this->_server, |
@@ -80,8 +78,7 @@ discard block |
||
| 80 | 78 | * @param InputInterface $input |
| 81 | 79 | * @param OutputInterface $output |
| 82 | 80 | */ |
| 83 | - protected function setVagrantSettings($helper, InputInterface $input, OutputInterface $output) |
|
| 84 | - { |
|
| 81 | + protected function setVagrantSettings($helper, InputInterface $input, OutputInterface $output) { |
|
| 85 | 82 | $output->writeln('<comment>Lets configure your project\'s VM</comment>'); |
| 86 | 83 | |
| 87 | 84 | $ipQuestion = new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
@@ -100,8 +97,7 @@ discard block |
||
| 100 | 97 | * @param OutputInterface $output |
| 101 | 98 | * @param $project |
| 102 | 99 | */ |
| 103 | - protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) |
|
| 104 | - { |
|
| 100 | + protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) { |
|
| 105 | 101 | $output->writeln('<comment>Lets configure your project\'s application</comment>'); |
| 106 | 102 | $appQuestion = new ChoiceQuestion( |
| 107 | 103 | "Which application do you want to install?", |
@@ -127,8 +123,7 @@ discard block |
||
| 127 | 123 | * @param OutputInterface $output |
| 128 | 124 | * @return boolean|integer |
| 129 | 125 | */ |
| 130 | - protected function setMagento2Settings($helper, InputInterface $input, OutputInterface $output) |
|
| 131 | - { |
|
| 126 | + protected function setMagento2Settings($helper, InputInterface $input, OutputInterface $output) { |
|
| 132 | 127 | if ($this->_app === 'magento2') { |
| 133 | 128 | $this->installSampleData($helper, $input, $output); |
| 134 | 129 | return $this->verifyAuth($helper, $input, $output); |
@@ -142,8 +137,7 @@ discard block |
||
| 142 | 137 | * @param InputInterface $input |
| 143 | 138 | * @param OutputInterface $output |
| 144 | 139 | */ |
| 145 | - protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
|
| 146 | - { |
|
| 140 | + protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) { |
|
| 147 | 141 | $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
| 148 | 142 | $versioning = $helper->ask($input, $output, $versionControl); |
| 149 | 143 | if ($versioning) { |
@@ -152,8 +146,7 @@ discard block |
||
| 152 | 146 | } |
| 153 | 147 | } |
| 154 | 148 | |
| 155 | - protected function installSampleData($helper, InputInterface $input, OutputInterface $output) |
|
| 156 | - { |
|
| 149 | + protected function installSampleData($helper, InputInterface $input, OutputInterface $output) { |
|
| 157 | 150 | $sampleInstall = new ConfirmationQuestion("Would you like to install sample data? (no/yes) ", false); |
| 158 | 151 | $this->installSampleData = $helper->ask($input, $output, $sampleInstall); |
| 159 | 152 | } |
@@ -163,8 +156,7 @@ discard block |
||
| 163 | 156 | * @param InputInterface $input |
| 164 | 157 | * @param OutputInterface $output |
| 165 | 158 | */ |
| 166 | - protected function askForAuth($helper, InputInterface $input, OutputInterface $output) |
|
| 167 | - { |
|
| 159 | + protected function askForAuth($helper, InputInterface $input, OutputInterface $output) { |
|
| 168 | 160 | $username = new Question("Please enter your Magento username (public key): ", ''); |
| 169 | 161 | $this->_m2Username = $helper->ask($input, $output, $username); |
| 170 | 162 | |
@@ -178,8 +170,7 @@ discard block |
||
| 178 | 170 | * @param OutputInterface $output |
| 179 | 171 | * @return boolean|integer |
| 180 | 172 | */ |
| 181 | - protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) |
|
| 182 | - { |
|
| 173 | + protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) { |
|
| 183 | 174 | $composerHome = (new Config($output))->getComposerHomeDir(); |
| 184 | 175 | $authFile = $composerHome . "/auth.json"; |
| 185 | 176 | |
@@ -214,8 +205,7 @@ discard block |
||
| 214 | 205 | * @param InputInterface $input |
| 215 | 206 | * @param OutputInterface $output |
| 216 | 207 | */ |
| 217 | - protected function setPhp($helper, InputInterface $input, OutputInterface $output) |
|
| 218 | - { |
|
| 208 | + protected function setPhp($helper, InputInterface $input, OutputInterface $output) { |
|
| 219 | 209 | $phpVerQuestion = new ChoiceQuestion( |
| 220 | 210 | "Which version of PHP should be installed?", |
| 221 | 211 | ['56', '70'], |
@@ -228,8 +218,7 @@ discard block |
||
| 228 | 218 | /** |
| 229 | 219 | * Set box name from concat user options |
| 230 | 220 | */ |
| 231 | - protected function setVagrantBox() |
|
| 232 | - { |
|
| 221 | + protected function setVagrantBox() { |
|
| 233 | 222 | $this->_box = self::BOX_PREFIX . $this->_os . "-$this->_server-php$this->_phpVer"; |
| 234 | 223 | } |
| 235 | 224 | |
@@ -238,8 +227,7 @@ discard block |
||
| 238 | 227 | * @param InputInterface $input |
| 239 | 228 | * @param OutputInterface $output |
| 240 | 229 | */ |
| 241 | - protected function setServerConfig($helper, InputInterface $input, OutputInterface $output) |
|
| 242 | - { |
|
| 230 | + protected function setServerConfig($helper, InputInterface $input, OutputInterface $output) { |
|
| 243 | 231 | $output->writeln('<comment>Lets configure your server</comment>'); |
| 244 | 232 | $this->setOperatingSystem($helper, $input, $output); |
| 245 | 233 | $this->setWebServer($helper, $input, $output); |
@@ -251,8 +239,7 @@ discard block |
||
| 251 | 239 | * @param InputInterface $input |
| 252 | 240 | * @param OutputInterface $output |
| 253 | 241 | */ |
| 254 | - protected function setWebServer($helper, InputInterface $input, OutputInterface $output) |
|
| 255 | - { |
|
| 242 | + protected function setWebServer($helper, InputInterface $input, OutputInterface $output) { |
|
| 256 | 243 | $serverQuestion = new ChoiceQuestion( |
| 257 | 244 | "Which webserver would you like?", |
| 258 | 245 | ['NGINX', 'Apache'], |
@@ -267,8 +254,7 @@ discard block |
||
| 267 | 254 | * @param InputInterface $input |
| 268 | 255 | * @param OutputInterface $output |
| 269 | 256 | */ |
| 270 | - protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) |
|
| 271 | - { |
|
| 257 | + protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) { |
|
| 272 | 258 | $osQuestion = new ChoiceQuestion( |
| 273 | 259 | "Which OS would you like to install?", |
| 274 | 260 | ['CentOS 6.5', 'Ubuntu 14'], |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | protected $_currency; |
| 30 | 30 | protected $_baseUrl; |
| 31 | 31 | protected $_repoUrl = ''; |
| 32 | - protected $installSampleData = false; |
|
| 32 | + protected $installSampleData = FALSE; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Options constructor. |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | return $this->verifyAuth($helper, $input, $output); |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - return true; |
|
| 137 | + return TRUE; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
| 146 | 146 | { |
| 147 | - $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
|
| 147 | + $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", FALSE); |
|
| 148 | 148 | $versioning = $helper->ask($input, $output, $versionControl); |
| 149 | 149 | if ($versioning) { |
| 150 | 150 | $repoQuestion = new Question("Enter your full GitHub/BitBucket repo URL: ", ''); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | protected function installSampleData($helper, InputInterface $input, OutputInterface $output) |
| 156 | 156 | { |
| 157 | - $sampleInstall = new ConfirmationQuestion("Would you like to install sample data? (no/yes) ", false); |
|
| 157 | + $sampleInstall = new ConfirmationQuestion("Would you like to install sample data? (no/yes) ", FALSE); |
|
| 158 | 158 | $this->installSampleData = $helper->ask($input, $output, $sampleInstall); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -186,10 +186,10 @@ discard block |
||
| 186 | 186 | $authObj = []; |
| 187 | 187 | if (file_exists($authFile) && is_readable($authFile)) { |
| 188 | 188 | $authJson = file_get_contents($authFile); |
| 189 | - $authObj = (array)json_decode($authJson, true); |
|
| 189 | + $authObj = (array)json_decode($authJson, TRUE); |
|
| 190 | 190 | |
| 191 | 191 | if (isset($authObj['http-basic']) && isset($authObj['http-basic']->{'repo.magento.com'})) { |
| 192 | - return true; |
|
| 192 | + return TRUE; |
|
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | |
@@ -4,4 +4,6 @@ |
||
| 4 | 4 | * Class MissingComposerHomeException |
| 5 | 5 | * @package Magestead\Exceptions |
| 6 | 6 | */ |
| 7 | -class MissingComposerHomeException extends \Exception {} |
|
| 8 | 7 | \ No newline at end of file |
| 8 | +class MissingComposerHomeException extends \Exception |
|
| 9 | +{ |
|
| 10 | +} |
|
| 9 | 11 | \ No newline at end of file |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function __construct(array $options, array $config, $projectPath, OutputInterface $output) |
| 30 | 30 | { |
| 31 | - $this->output = $output; |
|
| 31 | + $this->output=$output; |
|
| 32 | 32 | $this->composerInstall($projectPath, $output); |
| 33 | 33 | $this->installMagento($config, $options, $projectPath, $output); |
| 34 | 34 | $this->finaliseSetup($options, $projectPath, $output); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | protected function composerInstall($projectPath, OutputInterface $output) |
| 45 | 45 | { |
| 46 | 46 | $output->writeln('<info>Installing Magento 2 with Composer</info>'); |
| 47 | - $command = 'composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition public'; |
|
| 47 | + $command='composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition public'; |
|
| 48 | 48 | new ProcessCommand($command, $projectPath, $output); |
| 49 | 49 | |
| 50 | 50 | $this->copyAuthFile($projectPath); |
@@ -59,10 +59,10 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | protected function copyAuthFile($destination) |
| 61 | 61 | { |
| 62 | - $composerHome = (new Config($this->output))->getComposerHomeDir(); |
|
| 63 | - $authFile = $composerHome . "/auth.json"; |
|
| 62 | + $composerHome=(new Config($this->output))->getComposerHomeDir(); |
|
| 63 | + $authFile=$composerHome."/auth.json"; |
|
| 64 | 64 | |
| 65 | - return copy($authFile, $destination . '/public/auth.json'); |
|
| 65 | + return copy($authFile, $destination.'/public/auth.json'); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | protected function addPhpSpecPackage($projectPath, OutputInterface $output) |
| 73 | 73 | { |
| 74 | 74 | $output->writeln('<comment>Installing PHPSpec</comment>'); |
| 75 | - $command = 'cd '.$projectPath.'/public; composer require phpspec/phpspec --dev;'; |
|
| 75 | + $command='cd '.$projectPath.'/public; composer require phpspec/phpspec --dev;'; |
|
| 76 | 76 | new ProcessCommand($command, $projectPath, $output); |
| 77 | 77 | |
| 78 | 78 | $this->setPhpSpecPermissions($projectPath, $output); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | protected function addBehatPackage($projectPath, OutputInterface $output) |
| 86 | 86 | { |
| 87 | 87 | $output->writeln('<comment>Installing Behat</comment>'); |
| 88 | - $command = 'cd '.$projectPath.'/public; composer require behat/behat --dev;'; |
|
| 88 | + $command='cd '.$projectPath.'/public; composer require behat/behat --dev;'; |
|
| 89 | 89 | new ProcessCommand($command, $projectPath, $output); |
| 90 | 90 | |
| 91 | 91 | $this->setBehatPermissions($projectPath, $output); |
@@ -104,12 +104,12 @@ discard block |
||
| 104 | 104 | $this->installSampleData($options, $projectPath, $output); |
| 105 | 105 | |
| 106 | 106 | $output->writeln('<info>Installing Magento 2 Software</info>'); |
| 107 | - $locale = $config['magestead']['apps']['mba_12345']['locale']; |
|
| 108 | - $db_name = $config['magestead']['apps']['mba_12345']['db_name']; |
|
| 109 | - $base_url = $config['magestead']['apps']['mba_12345']['base_url']; |
|
| 110 | - $default_currency = $config['magestead']['apps']['mba_12345']['default_currency']; |
|
| 107 | + $locale=$config['magestead']['apps']['mba_12345']['locale']; |
|
| 108 | + $db_name=$config['magestead']['apps']['mba_12345']['db_name']; |
|
| 109 | + $base_url=$config['magestead']['apps']['mba_12345']['base_url']; |
|
| 110 | + $default_currency=$config['magestead']['apps']['mba_12345']['default_currency']; |
|
| 111 | 111 | |
| 112 | - $install = 'vagrant ssh -c \'cd /var/www/public; bin/magento setup:install --base-url=http://'.$base_url.'/ \ |
|
| 112 | + $install='vagrant ssh -c \'cd /var/www/public; bin/magento setup:install --base-url=http://'.$base_url.'/ \ |
|
| 113 | 113 | --db-host=localhost \ |
| 114 | 114 | --db-name='.$db_name.' \ |
| 115 | 115 | --db-user=magestead \ |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | if (true === $options['installSampleData']) { |
| 140 | 140 | $output->writeln('<info>Installing Magento 2 Sample Data</info>'); |
| 141 | - $deployCommand = 'vagrant ssh -c \'cd /var/www/public; bin/magento sampledata:deploy \''; |
|
| 141 | + $deployCommand='vagrant ssh -c \'cd /var/www/public; bin/magento sampledata:deploy \''; |
|
| 142 | 142 | new ProcessCommand($deployCommand, $projectPath, $output); |
| 143 | 143 | } |
| 144 | 144 | } |
@@ -150,15 +150,15 @@ discard block |
||
| 150 | 150 | protected function setPermissions($projectPath, OutputInterface $output) |
| 151 | 151 | { |
| 152 | 152 | $output->writeln('<info>Setting Permissions</info>'); |
| 153 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo find . -type d -exec chmod 700 {} \;\''; |
|
| 153 | + $command='vagrant ssh -c \'cd /var/www/public; sudo find . -type d -exec chmod 700 {} \;\''; |
|
| 154 | 154 | new ProcessCommand($command, $projectPath, $output); |
| 155 | 155 | $output->writeln('<comment>Folder Permissions Set</comment>'); |
| 156 | 156 | |
| 157 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo find . -type f -exec chmod 600 {} \;\''; |
|
| 157 | + $command='vagrant ssh -c \'cd /var/www/public; sudo find . -type f -exec chmod 600 {} \;\''; |
|
| 158 | 158 | new ProcessCommand($command, $projectPath, $output); |
| 159 | 159 | $output->writeln('<comment>File Permissions Set</comment>'); |
| 160 | 160 | |
| 161 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod +x bin/magento; sudo chmod 755 bin/phpspec; sudo chmod 755 bin/behat;\''; |
|
| 161 | + $command='vagrant ssh -c \'cd /var/www/public; sudo chmod +x bin/magento; sudo chmod 755 bin/phpspec; sudo chmod 755 bin/behat;\''; |
|
| 162 | 162 | new ProcessCommand($command, $projectPath, $output); |
| 163 | 163 | $output->writeln('<comment>bin/magento Permissions Set</comment>'); |
| 164 | 164 | } |
@@ -170,10 +170,10 @@ discard block |
||
| 170 | 170 | protected function configureRedis($projectPath, OutputInterface $output) |
| 171 | 171 | { |
| 172 | 172 | $output->writeln('<comment>Configuring Redis Cache</comment>'); |
| 173 | - $file = "$projectPath/public/app/etc/env.php"; |
|
| 174 | - $env = include $file; |
|
| 173 | + $file="$projectPath/public/app/etc/env.php"; |
|
| 174 | + $env=include $file; |
|
| 175 | 175 | |
| 176 | - $env['cache'] = [ |
|
| 176 | + $env['cache']=[ |
|
| 177 | 177 | 'frontend' => [ |
| 178 | 178 | 'default' => [ |
| 179 | 179 | 'backend' => 'Cm_Cache_Backend_Redis', |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | ], |
| 213 | 213 | ]; |
| 214 | 214 | |
| 215 | - file_put_contents($file, "<?php \n \n return ".var_export($env,true).";"); |
|
| 215 | + file_put_contents($file, "<?php \n \n return ".var_export($env, true).";"); |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |
@@ -222,11 +222,11 @@ discard block |
||
| 222 | 222 | */ |
| 223 | 223 | protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) |
| 224 | 224 | { |
| 225 | - $command = 'vagrant ssh -c \'cd /var/www/public; bin/magento indexer:reindex; \''; |
|
| 225 | + $command='vagrant ssh -c \'cd /var/www/public; bin/magento indexer:reindex; \''; |
|
| 226 | 226 | $output->writeln('<comment>Reindexing Tables</comment>'); |
| 227 | 227 | new ProcessCommand($command, $projectPath, $output); |
| 228 | 228 | |
| 229 | - $command = 'vagrant ssh -c \'cd /var/www/public; bin/magento cache:flush;\''; |
|
| 229 | + $command='vagrant ssh -c \'cd /var/www/public; bin/magento cache:flush;\''; |
|
| 230 | 230 | $output->writeln('<comment>Flushing All Cache</comment>'); |
| 231 | 231 | new ProcessCommand($command, $projectPath, $output); |
| 232 | 232 | |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | protected function showCredentials(array $options, OutputInterface $output) |
| 242 | 242 | { |
| 243 | 243 | $output->writeln('<info>SUCCESS: Magestead has finished installing Magento 2!</info>'); |
| 244 | - $table = new Table($output); |
|
| 244 | + $table=new Table($output); |
|
| 245 | 245 | $table |
| 246 | 246 | ->setHeaders(['Username', 'Password', 'Base URL', 'Admin URI']) |
| 247 | 247 | ->setRows([ |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | protected function processVcs(array $options, $projectPath, OutputInterface $output) |
| 262 | 262 | { |
| 263 | 263 | if (!empty($options['repo_url'])) { |
| 264 | - copy($projectPath . "/puphpet/magestead/magento2/stubs/gitignore.tmp", $projectPath . "/.gitignore"); |
|
| 264 | + copy($projectPath."/puphpet/magestead/magento2/stubs/gitignore.tmp", $projectPath."/.gitignore"); |
|
| 265 | 265 | return new VersionControl($options['repo_url'], $projectPath, $output); |
| 266 | 266 | } |
| 267 | 267 | } |
@@ -271,10 +271,10 @@ discard block |
||
| 271 | 271 | */ |
| 272 | 272 | protected function setComposerBinDir($projectPath) |
| 273 | 273 | { |
| 274 | - $file = "$projectPath/public/composer.json"; |
|
| 275 | - $composer = json_decode(file_get_contents($file), true); |
|
| 274 | + $file="$projectPath/public/composer.json"; |
|
| 275 | + $composer=json_decode(file_get_contents($file), true); |
|
| 276 | 276 | |
| 277 | - $composer['config']['bin-dir'] = 'bin'; |
|
| 277 | + $composer['config']['bin-dir']='bin'; |
|
| 278 | 278 | file_put_contents($file, json_encode($composer)); |
| 279 | 279 | } |
| 280 | 280 | |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | */ |
| 285 | 285 | protected function setPhpSpecPermissions($projectPath, OutputInterface $output) |
| 286 | 286 | { |
| 287 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/phpspec; bin/phpspec run\''; |
|
| 287 | + $command='vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/phpspec; bin/phpspec run\''; |
|
| 288 | 288 | new ProcessCommand($command, $projectPath, $output); |
| 289 | 289 | } |
| 290 | 290 | |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | protected function setBehatPermissions($projectPath, OutputInterface $output) |
| 296 | 296 | { |
| 297 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/behat; bin/behat --init\''; |
|
| 297 | + $command='vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/behat; bin/behat --init\''; |
|
| 298 | 298 | new ProcessCommand($command, $projectPath, $output); |
| 299 | 299 | } |
| 300 | 300 | } |
| 301 | 301 | \ No newline at end of file |
@@ -26,8 +26,7 @@ discard block |
||
| 26 | 26 | * @param $projectPath |
| 27 | 27 | * @param OutputInterface $output |
| 28 | 28 | */ |
| 29 | - public function __construct(array $options, array $config, $projectPath, OutputInterface $output) |
|
| 30 | - { |
|
| 29 | + public function __construct(array $options, array $config, $projectPath, OutputInterface $output) { |
|
| 31 | 30 | $this->output = $output; |
| 32 | 31 | $this->composerInstall($projectPath, $output); |
| 33 | 32 | $this->installMagento($config, $options, $projectPath, $output); |
@@ -41,8 +40,7 @@ discard block |
||
| 41 | 40 | * @param $projectPath |
| 42 | 41 | * @param OutputInterface $output |
| 43 | 42 | */ |
| 44 | - protected function composerInstall($projectPath, OutputInterface $output) |
|
| 45 | - { |
|
| 43 | + protected function composerInstall($projectPath, OutputInterface $output) { |
|
| 46 | 44 | $output->writeln('<info>Installing Magento 2 with Composer</info>'); |
| 47 | 45 | $command = 'composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition public'; |
| 48 | 46 | new ProcessCommand($command, $projectPath, $output); |
@@ -57,8 +55,7 @@ discard block |
||
| 57 | 55 | * @param $destination |
| 58 | 56 | * @return bool |
| 59 | 57 | */ |
| 60 | - protected function copyAuthFile($destination) |
|
| 61 | - { |
|
| 58 | + protected function copyAuthFile($destination) { |
|
| 62 | 59 | $composerHome = (new Config($this->output))->getComposerHomeDir(); |
| 63 | 60 | $authFile = $composerHome . "/auth.json"; |
| 64 | 61 | |
@@ -69,8 +66,7 @@ discard block |
||
| 69 | 66 | * @param $projectPath |
| 70 | 67 | * @param OutputInterface $output |
| 71 | 68 | */ |
| 72 | - protected function addPhpSpecPackage($projectPath, OutputInterface $output) |
|
| 73 | - { |
|
| 69 | + protected function addPhpSpecPackage($projectPath, OutputInterface $output) { |
|
| 74 | 70 | $output->writeln('<comment>Installing PHPSpec</comment>'); |
| 75 | 71 | $command = 'cd '.$projectPath.'/public; composer require phpspec/phpspec --dev;'; |
| 76 | 72 | new ProcessCommand($command, $projectPath, $output); |
@@ -82,8 +78,7 @@ discard block |
||
| 82 | 78 | * @param $projectPath |
| 83 | 79 | * @param OutputInterface $output |
| 84 | 80 | */ |
| 85 | - protected function addBehatPackage($projectPath, OutputInterface $output) |
|
| 86 | - { |
|
| 81 | + protected function addBehatPackage($projectPath, OutputInterface $output) { |
|
| 87 | 82 | $output->writeln('<comment>Installing Behat</comment>'); |
| 88 | 83 | $command = 'cd '.$projectPath.'/public; composer require behat/behat --dev;'; |
| 89 | 84 | new ProcessCommand($command, $projectPath, $output); |
@@ -97,8 +92,7 @@ discard block |
||
| 97 | 92 | * @param $projectPath |
| 98 | 93 | * @param OutputInterface $output |
| 99 | 94 | */ |
| 100 | - protected function installMagento(array $config, array $options, $projectPath, OutputInterface $output) |
|
| 101 | - { |
|
| 95 | + protected function installMagento(array $config, array $options, $projectPath, OutputInterface $output) { |
|
| 102 | 96 | $this->setPermissions($projectPath, $output); |
| 103 | 97 | |
| 104 | 98 | $this->installSampleData($options, $projectPath, $output); |
@@ -134,8 +128,7 @@ discard block |
||
| 134 | 128 | * @param $projectPath |
| 135 | 129 | * @param OutputInterface $output |
| 136 | 130 | */ |
| 137 | - protected function installSampleData($options, $projectPath, OutputInterface $output) |
|
| 138 | - { |
|
| 131 | + protected function installSampleData($options, $projectPath, OutputInterface $output) { |
|
| 139 | 132 | if (true === $options['installSampleData']) { |
| 140 | 133 | $output->writeln('<info>Installing Magento 2 Sample Data</info>'); |
| 141 | 134 | $deployCommand = 'vagrant ssh -c \'cd /var/www/public; bin/magento sampledata:deploy \''; |
@@ -147,8 +140,7 @@ discard block |
||
| 147 | 140 | * @param $projectPath |
| 148 | 141 | * @param OutputInterface $output |
| 149 | 142 | */ |
| 150 | - protected function setPermissions($projectPath, OutputInterface $output) |
|
| 151 | - { |
|
| 143 | + protected function setPermissions($projectPath, OutputInterface $output) { |
|
| 152 | 144 | $output->writeln('<info>Setting Permissions</info>'); |
| 153 | 145 | $command = 'vagrant ssh -c \'cd /var/www/public; sudo find . -type d -exec chmod 700 {} \;\''; |
| 154 | 146 | new ProcessCommand($command, $projectPath, $output); |
@@ -167,8 +159,7 @@ discard block |
||
| 167 | 159 | * @param $projectPath |
| 168 | 160 | * @param OutputInterface $output |
| 169 | 161 | */ |
| 170 | - protected function configureRedis($projectPath, OutputInterface $output) |
|
| 171 | - { |
|
| 162 | + protected function configureRedis($projectPath, OutputInterface $output) { |
|
| 172 | 163 | $output->writeln('<comment>Configuring Redis Cache</comment>'); |
| 173 | 164 | $file = "$projectPath/public/app/etc/env.php"; |
| 174 | 165 | $env = include $file; |
@@ -220,8 +211,7 @@ discard block |
||
| 220 | 211 | * @param $projectPath |
| 221 | 212 | * @param OutputInterface $output |
| 222 | 213 | */ |
| 223 | - protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) |
|
| 224 | - { |
|
| 214 | + protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) { |
|
| 225 | 215 | $command = 'vagrant ssh -c \'cd /var/www/public; bin/magento indexer:reindex; \''; |
| 226 | 216 | $output->writeln('<comment>Reindexing Tables</comment>'); |
| 227 | 217 | new ProcessCommand($command, $projectPath, $output); |
@@ -238,8 +228,7 @@ discard block |
||
| 238 | 228 | * @param array $options |
| 239 | 229 | * @param OutputInterface $output |
| 240 | 230 | */ |
| 241 | - protected function showCredentials(array $options, OutputInterface $output) |
|
| 242 | - { |
|
| 231 | + protected function showCredentials(array $options, OutputInterface $output) { |
|
| 243 | 232 | $output->writeln('<info>SUCCESS: Magestead has finished installing Magento 2!</info>'); |
| 244 | 233 | $table = new Table($output); |
| 245 | 234 | $table |
@@ -258,8 +247,7 @@ discard block |
||
| 258 | 247 | * @param OutputInterface $output |
| 259 | 248 | * @return VersionControl|null |
| 260 | 249 | */ |
| 261 | - protected function processVcs(array $options, $projectPath, OutputInterface $output) |
|
| 262 | - { |
|
| 250 | + protected function processVcs(array $options, $projectPath, OutputInterface $output) { |
|
| 263 | 251 | if (!empty($options['repo_url'])) { |
| 264 | 252 | copy($projectPath . "/puphpet/magestead/magento2/stubs/gitignore.tmp", $projectPath . "/.gitignore"); |
| 265 | 253 | return new VersionControl($options['repo_url'], $projectPath, $output); |
@@ -269,8 +257,7 @@ discard block |
||
| 269 | 257 | /** |
| 270 | 258 | * @param $projectPath |
| 271 | 259 | */ |
| 272 | - protected function setComposerBinDir($projectPath) |
|
| 273 | - { |
|
| 260 | + protected function setComposerBinDir($projectPath) { |
|
| 274 | 261 | $file = "$projectPath/public/composer.json"; |
| 275 | 262 | $composer = json_decode(file_get_contents($file), true); |
| 276 | 263 | |
@@ -282,8 +269,7 @@ discard block |
||
| 282 | 269 | * @param $projectPath |
| 283 | 270 | * @param OutputInterface $output |
| 284 | 271 | */ |
| 285 | - protected function setPhpSpecPermissions($projectPath, OutputInterface $output) |
|
| 286 | - { |
|
| 272 | + protected function setPhpSpecPermissions($projectPath, OutputInterface $output) { |
|
| 287 | 273 | $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/phpspec; bin/phpspec run\''; |
| 288 | 274 | new ProcessCommand($command, $projectPath, $output); |
| 289 | 275 | } |
@@ -292,8 +278,7 @@ discard block |
||
| 292 | 278 | * @param $projectPath |
| 293 | 279 | * @param OutputInterface $output |
| 294 | 280 | */ |
| 295 | - protected function setBehatPermissions($projectPath, OutputInterface $output) |
|
| 296 | - { |
|
| 281 | + protected function setBehatPermissions($projectPath, OutputInterface $output) { |
|
| 297 | 282 | $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/behat; bin/behat --init\''; |
| 298 | 283 | new ProcessCommand($command, $projectPath, $output); |
| 299 | 284 | } |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | protected function installSampleData($options, $projectPath, OutputInterface $output) |
| 138 | 138 | { |
| 139 | - if (true === $options['installSampleData']) { |
|
| 139 | + if (TRUE === $options['installSampleData']) { |
|
| 140 | 140 | $output->writeln('<info>Installing Magento 2 Sample Data</info>'); |
| 141 | 141 | $deployCommand = 'vagrant ssh -c \'cd /var/www/public; bin/magento sampledata:deploy \''; |
| 142 | 142 | new ProcessCommand($deployCommand, $projectPath, $output); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | ], |
| 213 | 213 | ]; |
| 214 | 214 | |
| 215 | - file_put_contents($file, "<?php \n \n return ".var_export($env,true).";"); |
|
| 215 | + file_put_contents($file, "<?php \n \n return ".var_export($env,TRUE).";"); |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | protected function setComposerBinDir($projectPath) |
| 273 | 273 | { |
| 274 | 274 | $file = "$projectPath/public/composer.json"; |
| 275 | - $composer = json_decode(file_get_contents($file), true); |
|
| 275 | + $composer = json_decode(file_get_contents($file), TRUE); |
|
| 276 | 276 | |
| 277 | 277 | $composer['config']['bin-dir'] = 'bin'; |
| 278 | 278 | file_put_contents($file, json_encode($composer)); |