@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | protected function configure() |
| 20 | 20 | { |
| 21 | - $this->_projectPath = getcwd(); |
|
| 21 | + $this->_projectPath=getcwd(); |
|
| 22 | 22 | $this->setName("index:mode:set"); |
| 23 | 23 | $this->setDescription("Set index mode type"); |
| 24 | 24 | $this->addArgument('mode', InputArgument::REQUIRED, '{realtime|schedule} [indexer]'); |
@@ -31,11 +31,11 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | protected function execute(InputInterface $input, OutputInterface $output) |
| 33 | 33 | { |
| 34 | - $indexMode = $input->getArgument('mode'); |
|
| 35 | - $command = $this->getCommand(new Config($output), $indexMode); |
|
| 34 | + $indexMode=$input->getArgument('mode'); |
|
| 35 | + $command=$this->getCommand(new Config($output), $indexMode); |
|
| 36 | 36 | if ($command) { |
| 37 | 37 | $output->writeln('<info>Setting index mode</info>'); |
| 38 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 38 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 39 | 39 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | protected function getCommand(Config $config, $mode) |
| 51 | 51 | { |
| 52 | - $type = $config->type; |
|
| 52 | + $type=$config->type; |
|
| 53 | 53 | switch ($type) { |
| 54 | 54 | case 'magento2': |
| 55 | 55 | return "cd /var/www/public;bin/magento indexer:set-mode $mode"; |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | protected function configure() |
| 20 | 20 | { |
| 21 | - $this->_projectPath = getcwd(); |
|
| 21 | + $this->_projectPath=getcwd(); |
|
| 22 | 22 | $this->setName("index:reindex"); |
| 23 | 23 | $this->setDescription("Reindex data"); |
| 24 | 24 | $this->addArgument('index', InputArgument::OPTIONAL, '[indexer]'); |
@@ -32,10 +32,10 @@ discard block |
||
| 32 | 32 | protected function execute(InputInterface $input, OutputInterface $output) |
| 33 | 33 | { |
| 34 | 34 | $output->writeln('<info>Reindexing data</info>'); |
| 35 | - $index = $input->getArgument('index'); |
|
| 35 | + $index=$input->getArgument('index'); |
|
| 36 | 36 | |
| 37 | - $command = $this->getCommand(new Config($output), $index); |
|
| 38 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 37 | + $command=$this->getCommand(new Config($output), $index); |
|
| 38 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 39 | 39 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -46,10 +46,10 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | protected function getCommand(Config $config, $index) |
| 48 | 48 | { |
| 49 | - $type = $config->type; |
|
| 49 | + $type=$config->type; |
|
| 50 | 50 | switch ($type) { |
| 51 | 51 | case 'magento': |
| 52 | - $index = (!is_null($index)) ? ' '.$index : ':all'; |
|
| 52 | + $index=(!is_null($index)) ? ' '.$index : ':all'; |
|
| 53 | 53 | return "cd /var/www/public;../bin/n98-magerun.phar index:reindex$index"; |
| 54 | 54 | break; |
| 55 | 55 | case 'magento2': |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | protected function configure() |
| 18 | 18 | { |
| 19 | - $this->_projectPath = getcwd(); |
|
| 19 | + $this->_projectPath=getcwd(); |
|
| 20 | 20 | $this->setName("redis:flush-all"); |
| 21 | 21 | $this->setDescription("Flush redis storage"); |
| 22 | 22 | } |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $output->writeln('<info>Flushing Redis Storage</info>'); |
| 32 | 32 | |
| 33 | - $command = "redis-cli flushall"; |
|
| 34 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 33 | + $command="redis-cli flushall"; |
|
| 34 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 35 | 35 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -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:status"); |
| 22 | 22 | $this->setDescription("Checks cache status"); |
| 23 | 23 | } |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $output->writeln('<info>Checking cache status</info>'); |
| 33 | 33 | |
| 34 | - $command = $this->getCommand(new Config($output)); |
|
| 35 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 34 | + $command=$this->getCommand(new Config($output)); |
|
| 35 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 36 | 36 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | protected function getCommand(Config $config) |
| 44 | 44 | { |
| 45 | - $type = $config->type; |
|
| 45 | + $type=$config->type; |
|
| 46 | 46 | switch ($type) { |
| 47 | 47 | case 'magento': |
| 48 | 48 | return "cd /var/www/public;../bin/n98-magerun.phar cache:list"; |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | protected function configure() |
| 18 | 18 | { |
| 19 | - $this->_projectPath = getcwd(); |
|
| 19 | + $this->_projectPath=getcwd(); |
|
| 20 | 20 | |
| 21 | 21 | $this->setName("behat"); |
| 22 | 22 | $this->setDescription("Run Behat against your project"); |
@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | protected function execute(InputInterface $input, OutputInterface $output) |
| 32 | 32 | { |
| 33 | - $option = $input->getArgument('option'); |
|
| 34 | - $command = $this->getCommand(new Config($output), $option); |
|
| 33 | + $option=$input->getArgument('option'); |
|
| 34 | + $command=$this->getCommand(new Config($output), $option); |
|
| 35 | 35 | if (!$command) { |
| 36 | 36 | return $output->writeln('<error>Command not available for this application</error>'); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $output->writeln('<info>Running Behat</info>'); |
| 40 | - $passedCommand = "vagrant ssh -c '". $command ."'"; |
|
| 40 | + $passedCommand="vagrant ssh -c '".$command."'"; |
|
| 41 | 41 | passthru($passedCommand); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | protected function getCommand(Config $config, $option) |
| 50 | 50 | { |
| 51 | - $type = $config->type; |
|
| 51 | + $type=$config->type; |
|
| 52 | 52 | switch ($type) { |
| 53 | 53 | case 'magento': |
| 54 | 54 | return "cd /var/www;bin/behat $option"; |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | protected function configure() |
| 24 | 24 | { |
| 25 | - $this->_basePath = dirname( __FILE__ ) . '/../../../'; |
|
| 26 | - $this->_projectPath = getcwd(); |
|
| 25 | + $this->_basePath=dirname(__FILE__).'/../../../'; |
|
| 26 | + $this->_projectPath=getcwd(); |
|
| 27 | 27 | |
| 28 | 28 | $this->setName("setup"); |
| 29 | 29 | $this->setDescription("Initialise Magestead project into current working directory"); |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | protected function execute(InputInterface $input, OutputInterface $output) |
| 38 | 38 | { |
| 39 | - $helper = $this->getHelper('question'); |
|
| 40 | - $options = new Options($helper, $input, $output); |
|
| 39 | + $helper=$this->getHelper('question'); |
|
| 40 | + $options=new Options($helper, $input, $output); |
|
| 41 | 41 | |
| 42 | 42 | $this->setupProject($output, $options); |
| 43 | 43 | |
@@ -55,17 +55,17 @@ discard block |
||
| 55 | 55 | protected function copyConfigFiles($source, $target, OutputInterface $output) |
| 56 | 56 | { |
| 57 | 57 | try { |
| 58 | - $progress = new ProgressBar($output, 3720); |
|
| 58 | + $progress=new ProgressBar($output, 3720); |
|
| 59 | 59 | $progress->start(); |
| 60 | 60 | foreach ( |
| 61 | - $iterator = new \RecursiveIteratorIterator( |
|
| 61 | + $iterator=new \RecursiveIteratorIterator( |
|
| 62 | 62 | new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS), |
| 63 | 63 | \RecursiveIteratorIterator::SELF_FIRST) as $item |
| 64 | 64 | ) { |
| 65 | 65 | if ($item->isDir()) { |
| 66 | - mkdir($target . DIRECTORY_SEPARATOR . $iterator->getSubPathName()); |
|
| 66 | + mkdir($target.DIRECTORY_SEPARATOR.$iterator->getSubPathName()); |
|
| 67 | 67 | } else { |
| 68 | - copy($item, $target . DIRECTORY_SEPARATOR . $iterator->getSubPathName()); |
|
| 68 | + copy($item, $target.DIRECTORY_SEPARATOR.$iterator->getSubPathName()); |
|
| 69 | 69 | } |
| 70 | 70 | $progress->advance(); |
| 71 | 71 | } |
@@ -82,20 +82,20 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | protected function configureProject(array $options, OutputInterface $output) |
| 84 | 84 | { |
| 85 | - $msConfig = $this->getConfigFile($output); |
|
| 85 | + $msConfig=$this->getConfigFile($output); |
|
| 86 | 86 | |
| 87 | - $app = ($options['app'] == 'magento 2') ? 'magento2' : 'magento'; |
|
| 87 | + $app=($options['app'] == 'magento 2') ? 'magento2' : 'magento'; |
|
| 88 | 88 | |
| 89 | - $msConfig['vagrantfile']['vm']['box'] = $options['box']; |
|
| 90 | - $msConfig['vagrantfile']['vm']['box_url'] = $options['box']; |
|
| 91 | - $msConfig['vagrantfile']['vm']['memory'] = $options['memory_limit']; |
|
| 92 | - $msConfig['vagrantfile']['vm']['network']['private_network'] = $options['ip_address']; |
|
| 93 | - $msConfig['magestead']['apps']['mba_12345']['type'] = $app; |
|
| 94 | - $msConfig['magestead']['apps']['mba_12345']['locale'] = $options['locale']; |
|
| 95 | - $msConfig['magestead']['apps']['mba_12345']['default_currency'] = $options['default_currency']; |
|
| 96 | - $msConfig['magestead']['apps']['mba_12345']['base_url'] = $options['base_url']; |
|
| 97 | - $msConfig['magestead']['os'] = $options['os']; |
|
| 98 | - $msConfig['magestead']['server'] = $options['server']; |
|
| 89 | + $msConfig['vagrantfile']['vm']['box']=$options['box']; |
|
| 90 | + $msConfig['vagrantfile']['vm']['box_url']=$options['box']; |
|
| 91 | + $msConfig['vagrantfile']['vm']['memory']=$options['memory_limit']; |
|
| 92 | + $msConfig['vagrantfile']['vm']['network']['private_network']=$options['ip_address']; |
|
| 93 | + $msConfig['magestead']['apps']['mba_12345']['type']=$app; |
|
| 94 | + $msConfig['magestead']['apps']['mba_12345']['locale']=$options['locale']; |
|
| 95 | + $msConfig['magestead']['apps']['mba_12345']['default_currency']=$options['default_currency']; |
|
| 96 | + $msConfig['magestead']['apps']['mba_12345']['base_url']=$options['base_url']; |
|
| 97 | + $msConfig['magestead']['os']=$options['os']; |
|
| 98 | + $msConfig['magestead']['server']=$options['server']; |
|
| 99 | 99 | |
| 100 | 100 | $this->saveConfigFile($msConfig, $output); |
| 101 | 101 | |
@@ -107,9 +107,9 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | protected function getConfigFile(OutputInterface $output) |
| 109 | 109 | { |
| 110 | - $yaml = new Parser(); |
|
| 110 | + $yaml=new Parser(); |
|
| 111 | 111 | try { |
| 112 | - return $yaml->parse(file_get_contents($this->_projectPath . '/magestead.yaml')); |
|
| 112 | + return $yaml->parse(file_get_contents($this->_projectPath.'/magestead.yaml')); |
|
| 113 | 113 | } catch (ParseException $e) { |
| 114 | 114 | $output->writeln('<error>Unable to parse the YAML string</error>'); |
| 115 | 115 | printf("Unable to parse the YAML string: %s", $e->getMessage()); |
@@ -122,11 +122,11 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | protected function saveConfigFile(array $config, OutputInterface $output) |
| 124 | 124 | { |
| 125 | - $dumper = new Dumper(); |
|
| 126 | - $yaml = $dumper->dump($config, 6); |
|
| 125 | + $dumper=new Dumper(); |
|
| 126 | + $yaml=$dumper->dump($config, 6); |
|
| 127 | 127 | |
| 128 | 128 | try { |
| 129 | - file_put_contents($this->_projectPath . '/magestead.yaml', $yaml); |
|
| 129 | + file_put_contents($this->_projectPath.'/magestead.yaml', $yaml); |
|
| 130 | 130 | } catch (\Exception $e) { |
| 131 | 131 | $output->writeln('<error>Unable to write to the YAML file</error>'); |
| 132 | 132 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | protected function setupProject(OutputInterface $output, $options) |
| 140 | 140 | { |
| 141 | 141 | $output->writeln('<info>Setting up project structure</info>'); |
| 142 | - $provisionFolder = $this->_basePath . "provision"; |
|
| 142 | + $provisionFolder=$this->_basePath."provision"; |
|
| 143 | 143 | $this->copyConfigFiles($provisionFolder, $this->_projectPath, $output); |
| 144 | 144 | $this->configureProject($options->getAllOptions(), $output); |
| 145 | 145 | } |
@@ -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:status"); |
| 22 | 22 | $this->setDescription("Checks cache status"); |
| 23 | 23 | } |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $output->writeln('<info>Checking cache status</info>'); |
| 33 | 33 | |
| 34 | - $command = $this->getCommand(new Config($output)); |
|
| 35 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 34 | + $command=$this->getCommand(new Config($output)); |
|
| 35 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 36 | 36 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | protected function getCommand(Config $config) |
| 44 | 44 | { |
| 45 | - $type = $config->type; |
|
| 45 | + $type=$config->type; |
|
| 46 | 46 | switch ($type) { |
| 47 | 47 | case 'magento': |
| 48 | 48 | return "cd /var/www/public;../bin/n98-magerun.phar cache:list"; |
@@ -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:status"); |
| 22 | 22 | $this->setDescription("Checks cache status"); |
| 23 | 23 | } |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $output->writeln('<info>Checking cache status</info>'); |
| 33 | 33 | |
| 34 | - $command = $this->getCommand(new Config($output)); |
|
| 35 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 34 | + $command=$this->getCommand(new Config($output)); |
|
| 35 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 36 | 36 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | protected function getCommand(Config $config) |
| 44 | 44 | { |
| 45 | - $type = $config->type; |
|
| 45 | + $type=$config->type; |
|
| 46 | 46 | switch ($type) { |
| 47 | 47 | case 'magento': |
| 48 | 48 | return "cd /var/www/public;../bin/n98-magerun.phar cache:list"; |
@@ -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:status"); |
| 22 | 22 | $this->setDescription("Checks cache status"); |
| 23 | 23 | } |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $output->writeln('<info>Checking cache status</info>'); |
| 33 | 33 | |
| 34 | - $command = $this->getCommand(new Config($output)); |
|
| 35 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 34 | + $command=$this->getCommand(new Config($output)); |
|
| 35 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 36 | 36 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | protected function getCommand(Config $config) |
| 44 | 44 | { |
| 45 | - $type = $config->type; |
|
| 45 | + $type=$config->type; |
|
| 46 | 46 | switch ($type) { |
| 47 | 47 | case 'magento': |
| 48 | 48 | return "cd /var/www/public;../bin/n98-magerun.phar cache:list"; |