@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | protected function configure() |
| 28 | 28 | { |
| 29 | - $this->_basePath = dirname(__FILE__).'/../../../'; |
|
| 30 | - $this->_projectPath = getcwd(); |
|
| 29 | + $this->_basePath=dirname(__FILE__).'/../../../'; |
|
| 30 | + $this->_projectPath=getcwd(); |
|
| 31 | 31 | |
| 32 | 32 | $this->setName('new'); |
| 33 | 33 | $this->setDescription('Initialise new Magestead project into current working directory'); |
@@ -44,10 +44,10 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | protected function execute(InputInterface $input, OutputInterface $output) |
| 46 | 46 | { |
| 47 | - $project = $this->setProject($input); |
|
| 47 | + $project=$this->setProject($input); |
|
| 48 | 48 | |
| 49 | - $helper = $this->getHelper('question'); |
|
| 50 | - $options = new Options($helper, $input, $output, $project); |
|
| 49 | + $helper=$this->getHelper('question'); |
|
| 50 | + $options=new Options($helper, $input, $output, $project); |
|
| 51 | 51 | |
| 52 | 52 | $this->setupProject($output, $options); |
| 53 | 53 | |
@@ -65,10 +65,10 @@ discard block |
||
| 65 | 65 | protected function copyConfigFiles($source, $target, OutputInterface $output) |
| 66 | 66 | { |
| 67 | 67 | try { |
| 68 | - $progress = new ProgressBar($output, 3720); |
|
| 68 | + $progress=new ProgressBar($output, 3720); |
|
| 69 | 69 | $progress->start(); |
| 70 | 70 | foreach ( |
| 71 | - $iterator = new \RecursiveIteratorIterator( |
|
| 71 | + $iterator=new \RecursiveIteratorIterator( |
|
| 72 | 72 | new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS), |
| 73 | 73 | \RecursiveIteratorIterator::SELF_FIRST) as $item |
| 74 | 74 | ) { |
@@ -92,24 +92,24 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | protected function configureProject(array $options, OutputInterface $output) |
| 94 | 94 | { |
| 95 | - $msConfig = $this->getConfigFile($output); |
|
| 95 | + $msConfig=$this->getConfigFile($output); |
|
| 96 | 96 | |
| 97 | - $app = ($options['app'] == 'magento2') ? 'magento2' : 'magento'; |
|
| 98 | - $hostname = 'magestead-'.$options['base_url']; |
|
| 97 | + $app=($options['app'] == 'magento2') ? 'magento2' : 'magento'; |
|
| 98 | + $hostname='magestead-'.$options['base_url']; |
|
| 99 | 99 | |
| 100 | - $msConfig['vagrantfile']['vm']['box'] = $options['box']; |
|
| 101 | - $msConfig['vagrantfile']['vm']['box_url'] = $options['box']; |
|
| 102 | - $msConfig['vagrantfile']['vm']['hostname'] = $hostname; |
|
| 103 | - $msConfig['vagrantfile']['vm']['memory'] = $options['memory_limit']; |
|
| 104 | - $msConfig['vagrantfile']['vm']['network']['private_network'] = $options['ip_address']; |
|
| 105 | - $msConfig['magestead']['apps']['mba_12345']['type'] = $app; |
|
| 106 | - $msConfig['magestead']['apps']['mba_12345']['locale'] = $options['locale']; |
|
| 107 | - $msConfig['magestead']['apps']['mba_12345']['default_currency'] = $options['default_currency']; |
|
| 108 | - $msConfig['magestead']['apps']['mba_12345']['base_url'] = $options['base_url']; |
|
| 109 | - $msConfig['magestead']['os'] = $options['os']; |
|
| 110 | - $msConfig['magestead']['server'] = $options['server']; |
|
| 100 | + $msConfig['vagrantfile']['vm']['box']=$options['box']; |
|
| 101 | + $msConfig['vagrantfile']['vm']['box_url']=$options['box']; |
|
| 102 | + $msConfig['vagrantfile']['vm']['hostname']=$hostname; |
|
| 103 | + $msConfig['vagrantfile']['vm']['memory']=$options['memory_limit']; |
|
| 104 | + $msConfig['vagrantfile']['vm']['network']['private_network']=$options['ip_address']; |
|
| 105 | + $msConfig['magestead']['apps']['mba_12345']['type']=$app; |
|
| 106 | + $msConfig['magestead']['apps']['mba_12345']['locale']=$options['locale']; |
|
| 107 | + $msConfig['magestead']['apps']['mba_12345']['default_currency']=$options['default_currency']; |
|
| 108 | + $msConfig['magestead']['apps']['mba_12345']['base_url']=$options['base_url']; |
|
| 109 | + $msConfig['magestead']['os']=$options['os']; |
|
| 110 | + $msConfig['magestead']['server']=$options['server']; |
|
| 111 | 111 | |
| 112 | - $this->_msConfig = $msConfig; |
|
| 112 | + $this->_msConfig=$msConfig; |
|
| 113 | 113 | |
| 114 | 114 | $this->saveConfigFile($msConfig, $output); |
| 115 | 115 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | protected function getConfigFile(OutputInterface $output) |
| 123 | 123 | { |
| 124 | - $yaml = new Parser(); |
|
| 124 | + $yaml=new Parser(); |
|
| 125 | 125 | try { |
| 126 | 126 | return $yaml->parse(file_get_contents($this->_projectPath.'/magestead.yaml')); |
| 127 | 127 | } catch (ParseException $e) { |
@@ -136,8 +136,8 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | protected function saveConfigFile(array $config, OutputInterface $output) |
| 138 | 138 | { |
| 139 | - $dumper = new Dumper(); |
|
| 140 | - $yaml = $dumper->dump($config, 6); |
|
| 139 | + $dumper=new Dumper(); |
|
| 140 | + $yaml=$dumper->dump($config, 6); |
|
| 141 | 141 | |
| 142 | 142 | try { |
| 143 | 143 | file_put_contents($this->_projectPath.'/magestead.yaml', $yaml); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | protected function setupProject(OutputInterface $output, $options) |
| 154 | 154 | { |
| 155 | 155 | $output->writeln('<info>Setting up project structure</info>'); |
| 156 | - $provisionFolder = $this->_basePath.'provision'; |
|
| 156 | + $provisionFolder=$this->_basePath.'provision'; |
|
| 157 | 157 | $this->copyConfigFiles($provisionFolder, $this->_projectPath, $output); |
| 158 | 158 | $this->configureProject($options->getAllOptions(), $output); |
| 159 | 159 | |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | protected function setProject(InputInterface $input) |
| 171 | 171 | { |
| 172 | - $project = $input->getArgument('project'); |
|
| 173 | - $this->_projectPath = $this->_projectPath.'/'.$project; |
|
| 172 | + $project=$input->getArgument('project'); |
|
| 173 | + $this->_projectPath=$this->_projectPath.'/'.$project; |
|
| 174 | 174 | |
| 175 | 175 | if (is_dir($this->_projectPath)) { |
| 176 | 176 | throw new ExistingProjectException('Target project directory already exists'); |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | protected function configure() |
| 24 | 24 | { |
| 25 | - $this->_projectPath = getcwd(); |
|
| 25 | + $this->_projectPath=getcwd(); |
|
| 26 | 26 | $this->setName('log:stream'); |
| 27 | 27 | $this->setDescription('Stream a specific server log'); |
| 28 | 28 | $this->addArgument('log', InputArgument::REQUIRED, 'access or error'); |
@@ -36,15 +36,15 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | protected function execute(InputInterface $input, OutputInterface $output) |
| 38 | 38 | { |
| 39 | - $log = $input->getArgument('log'); |
|
| 39 | + $log=$input->getArgument('log'); |
|
| 40 | 40 | |
| 41 | 41 | $output->writeln('<info>Streaming '.ucwords($log).' Log</info>'); |
| 42 | - $command = $this->getCommand(new Config($output), $log); |
|
| 42 | + $command=$this->getCommand(new Config($output), $log); |
|
| 43 | 43 | if (!$command) { |
| 44 | 44 | return $output->writeln('<error>Command not available for this application</error>'); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - $pCommand = "vagrant ssh -c '".$command."'"; |
|
| 47 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 48 | 48 | |
| 49 | 49 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 50 | 50 | } |
@@ -57,11 +57,11 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | private function getCommand(Config $config, $log) |
| 59 | 59 | { |
| 60 | - $server = $config->_config['magestead']['server']; |
|
| 61 | - $os = $config->_config['magestead']['os']; |
|
| 60 | + $server=$config->_config['magestead']['server']; |
|
| 61 | + $os=$config->_config['magestead']['os']; |
|
| 62 | 62 | |
| 63 | - $location = $this->getLogLocation($server, $os); |
|
| 64 | - $command = 'tail -f /var/log/'.$location.'/'.$config->base_url.'-'.$log.'.log'; |
|
| 63 | + $location=$this->getLogLocation($server, $os); |
|
| 64 | + $command='tail -f /var/log/'.$location.'/'.$config->base_url.'-'.$log.'.log'; |
|
| 65 | 65 | |
| 66 | 66 | return $command; |
| 67 | 67 | } |
@@ -74,9 +74,9 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | private function getLogLocation($server, $os) |
| 76 | 76 | { |
| 77 | - $location = 'nginx'; |
|
| 77 | + $location='nginx'; |
|
| 78 | 78 | if ($server != 'nginx') { |
| 79 | - $location = ($os == 'ubuntu14') ? 'apache2' : 'httpd'; |
|
| 79 | + $location=($os == 'ubuntu14') ? 'apache2' : 'httpd'; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | return $location; |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | protected function configure() |
| 24 | 24 | { |
| 25 | - $this->_projectPath = getcwd(); |
|
| 25 | + $this->_projectPath=getcwd(); |
|
| 26 | 26 | $this->setName('log:view'); |
| 27 | 27 | $this->setDescription('View a specific server log'); |
| 28 | 28 | $this->addArgument('log', InputArgument::REQUIRED, 'access or error'); |
@@ -36,15 +36,15 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | protected function execute(InputInterface $input, OutputInterface $output) |
| 38 | 38 | { |
| 39 | - $log = $input->getArgument('log'); |
|
| 39 | + $log=$input->getArgument('log'); |
|
| 40 | 40 | |
| 41 | 41 | $output->writeln('<info>Viewing '.ucwords($log).' Log</info>'); |
| 42 | - $command = $this->getCommand(new Config($output), $log); |
|
| 42 | + $command=$this->getCommand(new Config($output), $log); |
|
| 43 | 43 | if (!$command) { |
| 44 | 44 | return $output->writeln('<error>Command not available for this application</error>'); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - $pCommand = "vagrant ssh -c '".$command."'"; |
|
| 47 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 48 | 48 | |
| 49 | 49 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 50 | 50 | } |
@@ -57,11 +57,11 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | private function getCommand(Config $config, $log) |
| 59 | 59 | { |
| 60 | - $server = $config->_config['magestead']['server']; |
|
| 61 | - $os = $config->_config['magestead']['os']; |
|
| 60 | + $server=$config->_config['magestead']['server']; |
|
| 61 | + $os=$config->_config['magestead']['os']; |
|
| 62 | 62 | |
| 63 | - $location = $this->getLogLocation($server, $os); |
|
| 64 | - $command = 'cat /var/log/'.$location.'/'.$config->base_url.'-'.$log.'.log'; |
|
| 63 | + $location=$this->getLogLocation($server, $os); |
|
| 64 | + $command='cat /var/log/'.$location.'/'.$config->base_url.'-'.$log.'.log'; |
|
| 65 | 65 | |
| 66 | 66 | return $command; |
| 67 | 67 | } |
@@ -74,9 +74,9 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | private function getLogLocation($server, $os) |
| 76 | 76 | { |
| 77 | - $location = 'nginx'; |
|
| 77 | + $location='nginx'; |
|
| 78 | 78 | if ($server != 'nginx') { |
| 79 | - $location = ($os == 'ubuntu14') ? 'apache2' : 'httpd'; |
|
| 79 | + $location=($os == 'ubuntu14') ? 'apache2' : 'httpd'; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | return $location; |
@@ -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 | |
| 22 | 22 | $this->setName('phpspec'); |
| 23 | 23 | $this->setDescription('Run PHPSpec against your project'); |
@@ -32,15 +32,15 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | protected function execute(InputInterface $input, OutputInterface $output) |
| 34 | 34 | { |
| 35 | - $option = $input->getArgument('option'); |
|
| 35 | + $option=$input->getArgument('option'); |
|
| 36 | 36 | |
| 37 | - $command = $this->getCommand(new Config($output), $option); |
|
| 37 | + $command=$this->getCommand(new Config($output), $option); |
|
| 38 | 38 | if (!$command) { |
| 39 | 39 | return $output->writeln('<error>Command not available for this application</error>'); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $output->writeln('<info>Running PHPSpec</info>'); |
| 43 | - $passedCommand = "vagrant ssh -c '".$command."'"; |
|
| 43 | + $passedCommand="vagrant ssh -c '".$command."'"; |
|
| 44 | 44 | passthru($passedCommand); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | protected function getCommand(Config $config, $option) |
| 54 | 54 | { |
| 55 | - $type = $config->type; |
|
| 55 | + $type=$config->type; |
|
| 56 | 56 | switch ($type) { |
| 57 | 57 | case 'magento': |
| 58 | 58 | return "cd /var/www;bin/phpspec $option"; |
@@ -18,8 +18,8 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public function __construct(OutputInterface $output) |
| 20 | 20 | { |
| 21 | - $this->_projectPath = getcwd(); |
|
| 22 | - $this->_config = $this->getConfigFile($output); |
|
| 21 | + $this->_projectPath=getcwd(); |
|
| 22 | + $this->_config=$this->getConfigFile($output); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | protected function getConfigFile(OutputInterface $output) |
| 41 | 41 | { |
| 42 | - $config = new Parser(); |
|
| 42 | + $config=new Parser(); |
|
| 43 | 43 | try { |
| 44 | 44 | return $config->parse($this->readConfigFile()); |
| 45 | 45 | } catch (ParseException $e) { |
@@ -16,8 +16,7 @@ discard block |
||
| 16 | 16 | * |
| 17 | 17 | * @param OutputInterface $output |
| 18 | 18 | */ |
| 19 | - public function __construct(OutputInterface $output) |
|
| 20 | - { |
|
| 19 | + public function __construct(OutputInterface $output) { |
|
| 21 | 20 | $this->_projectPath = getcwd(); |
| 22 | 21 | $this->_config = $this->getConfigFile($output); |
| 23 | 22 | } |
@@ -27,8 +26,7 @@ discard block |
||
| 27 | 26 | * |
| 28 | 27 | * @return mixed |
| 29 | 28 | */ |
| 30 | - public function __get($name) |
|
| 31 | - { |
|
| 29 | + public function __get($name) { |
|
| 32 | 30 | return $this->_config['magestead']['apps']['mba_12345'][$name]; |
| 33 | 31 | } |
| 34 | 32 | |
@@ -37,8 +35,7 @@ discard block |
||
| 37 | 35 | * |
| 38 | 36 | * @return bool|mixed |
| 39 | 37 | */ |
| 40 | - protected function getConfigFile(OutputInterface $output) |
|
| 41 | - { |
|
| 38 | + protected function getConfigFile(OutputInterface $output) { |
|
| 42 | 39 | $config = new Parser(); |
| 43 | 40 | try { |
| 44 | 41 | return $config->parse($this->readConfigFile()); |
@@ -54,8 +51,7 @@ discard block |
||
| 54 | 51 | * |
| 55 | 52 | * @return string |
| 56 | 53 | */ |
| 57 | - protected function readConfigFile() |
|
| 58 | - { |
|
| 54 | + protected function readConfigFile() { |
|
| 59 | 55 | if (!file_exists($this->_projectPath.'/magestead.yaml')) { |
| 60 | 56 | throw new MissingConfigFileException('No config file was found, are you in the project root?'); |
| 61 | 57 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | public static function verify(array $options, OutputInterface $output) |
| 17 | 17 | { |
| 18 | - $hostPlugin = `vagrant plugin list | grep vagrant-hostsupdater`; |
|
| 18 | + $hostPlugin=`vagrant plugin list | grep vagrant-hostsupdater`; |
|
| 19 | 19 | if (is_null($hostPlugin)) { |
| 20 | 20 | self::editHostsInstructions($options, $output); |
| 21 | 21 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | protected static function editHostsInstructions(array $options, OutputInterface $output) |
| 34 | 34 | { |
| 35 | 35 | $output->writeln('<comment>NOTE: You will need to add the following to your hosts file!</comment>'); |
| 36 | - $comment = $options['vagrantfile']['vm']['network']['private_network']. |
|
| 36 | + $comment=$options['vagrantfile']['vm']['network']['private_network']. |
|
| 37 | 37 | ' '.$options['magestead']['apps']['mba_12345']['base_url']; |
| 38 | 38 | $output->writeln('<info>'.$comment.'</info>'); |
| 39 | 39 | } |
@@ -57,20 +57,20 @@ |
||
| 57 | 57 | public function getAllOptions() |
| 58 | 58 | { |
| 59 | 59 | return [ |
| 60 | - 'app' => $this->_app, |
|
| 61 | - 'server' => $this->_server, |
|
| 62 | - 'phpver' => $this->_phpVer, |
|
| 63 | - 'os' => $this->_os, |
|
| 64 | - 'box' => $this->_box, |
|
| 65 | - 'm2user' => $this->_m2Username, |
|
| 66 | - 'm2pass' => $this->_m2Password, |
|
| 67 | - 'repo_url' => $this->_repoUrl, |
|
| 68 | - 'ip_address' => $this->_ipAddress, |
|
| 69 | - 'cpus' => $this->_cpus, |
|
| 70 | - 'memory_limit' => $this->_memorylimit, |
|
| 71 | - 'locale' => $this->_locale, |
|
| 72 | - 'default_currency' => $this->_currency, |
|
| 73 | - 'base_url' => $this->_baseUrl, |
|
| 60 | + 'app' => $this->_app, |
|
| 61 | + 'server' => $this->_server, |
|
| 62 | + 'phpver' => $this->_phpVer, |
|
| 63 | + 'os' => $this->_os, |
|
| 64 | + 'box' => $this->_box, |
|
| 65 | + 'm2user' => $this->_m2Username, |
|
| 66 | + 'm2pass' => $this->_m2Password, |
|
| 67 | + 'repo_url' => $this->_repoUrl, |
|
| 68 | + 'ip_address' => $this->_ipAddress, |
|
| 69 | + 'cpus' => $this->_cpus, |
|
| 70 | + 'memory_limit' => $this->_memorylimit, |
|
| 71 | + 'locale' => $this->_locale, |
|
| 72 | + 'default_currency' => $this->_currency, |
|
| 73 | + 'base_url' => $this->_baseUrl, |
|
| 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,7 +28,7 @@ discard block |
||
| 28 | 28 | protected $_locale; |
| 29 | 29 | protected $_currency; |
| 30 | 30 | protected $_baseUrl; |
| 31 | - protected $_repoUrl = ''; |
|
| 31 | + protected $_repoUrl=''; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Options constructor. |
@@ -83,14 +83,14 @@ discard block |
||
| 83 | 83 | { |
| 84 | 84 | $output->writeln('<comment>Lets configure your project\'s VM</comment>'); |
| 85 | 85 | |
| 86 | - $ipQuestion = new Question('Configure the IP for your VM (192.168.47.47): ', '192.168.47.47'); |
|
| 87 | - $this->_ipAddress = strtolower($helper->ask($input, $output, $ipQuestion)); |
|
| 86 | + $ipQuestion=new Question('Configure the IP for your VM (192.168.47.47): ', '192.168.47.47'); |
|
| 87 | + $this->_ipAddress=strtolower($helper->ask($input, $output, $ipQuestion)); |
|
| 88 | 88 | |
| 89 | - $cpuQuestion = new Question("How many CPU's would you like to use? (1): ", '1'); |
|
| 90 | - $this->_cpus = strtolower($helper->ask($input, $output, $cpuQuestion)); |
|
| 89 | + $cpuQuestion=new Question("How many CPU's would you like to use? (1): ", '1'); |
|
| 90 | + $this->_cpus=strtolower($helper->ask($input, $output, $cpuQuestion)); |
|
| 91 | 91 | |
| 92 | - $memoryQuestion = new Question('Define the VM memory limit (2048): ', '2048'); |
|
| 93 | - $this->_memorylimit = strtolower($helper->ask($input, $output, $memoryQuestion)); |
|
| 92 | + $memoryQuestion=new Question('Define the VM memory limit (2048): ', '2048'); |
|
| 93 | + $this->_memorylimit=strtolower($helper->ask($input, $output, $memoryQuestion)); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -102,22 +102,22 @@ discard block |
||
| 102 | 102 | protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) |
| 103 | 103 | { |
| 104 | 104 | $output->writeln('<comment>Lets configure your project\'s application</comment>'); |
| 105 | - $appQuestion = new ChoiceQuestion( |
|
| 105 | + $appQuestion=new ChoiceQuestion( |
|
| 106 | 106 | 'Which application do you want to install?', |
| 107 | 107 | ['Magento', 'Magento2'], |
| 108 | 108 | 0 |
| 109 | 109 | ); |
| 110 | 110 | |
| 111 | - $this->_app = strtolower($helper->ask($input, $output, $appQuestion)); |
|
| 111 | + $this->_app=strtolower($helper->ask($input, $output, $appQuestion)); |
|
| 112 | 112 | |
| 113 | - $baseUrlQuestion = new Question("Enter your application's base_url ($project.dev): ", $project.'.dev'); |
|
| 114 | - $this->_baseUrl = strtolower($helper->ask($input, $output, $baseUrlQuestion)); |
|
| 113 | + $baseUrlQuestion=new Question("Enter your application's base_url ($project.dev): ", $project.'.dev'); |
|
| 114 | + $this->_baseUrl=strtolower($helper->ask($input, $output, $baseUrlQuestion)); |
|
| 115 | 115 | |
| 116 | - $currenyQuestion = new Question("Enter your application's default currency (GBP): ", 'GBP'); |
|
| 117 | - $this->_currency = $helper->ask($input, $output, $currenyQuestion); |
|
| 116 | + $currenyQuestion=new Question("Enter your application's default currency (GBP): ", 'GBP'); |
|
| 117 | + $this->_currency=$helper->ask($input, $output, $currenyQuestion); |
|
| 118 | 118 | |
| 119 | - $localeQuestion = new Question("Enter your application's default locale (en_GB): ", 'en_GB'); |
|
| 120 | - $this->_locale = $helper->ask($input, $output, $localeQuestion); |
|
| 119 | + $localeQuestion=new Question("Enter your application's default locale (en_GB): ", 'en_GB'); |
|
| 120 | + $this->_locale=$helper->ask($input, $output, $localeQuestion); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -143,11 +143,11 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
| 145 | 145 | { |
| 146 | - $versionControl = new ConfirmationQuestion('Would you like to add your project to GIT? (no/yes) ', false); |
|
| 147 | - $versioning = $helper->ask($input, $output, $versionControl); |
|
| 146 | + $versionControl=new ConfirmationQuestion('Would you like to add your project to GIT? (no/yes) ', false); |
|
| 147 | + $versioning=$helper->ask($input, $output, $versionControl); |
|
| 148 | 148 | if ($versioning) { |
| 149 | - $repoQuestion = new Question('Enter your full GitHub/BitBucket repo URL: ', ''); |
|
| 150 | - $this->_repoUrl = strtolower($helper->ask($input, $output, $repoQuestion)); |
|
| 149 | + $repoQuestion=new Question('Enter your full GitHub/BitBucket repo URL: ', ''); |
|
| 150 | + $this->_repoUrl=strtolower($helper->ask($input, $output, $repoQuestion)); |
|
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
@@ -158,11 +158,11 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | protected function askForAuth($helper, InputInterface $input, OutputInterface $output) |
| 160 | 160 | { |
| 161 | - $username = new Question('Please enter your Magento username (public key): ', ''); |
|
| 162 | - $this->_m2Username = $helper->ask($input, $output, $username); |
|
| 161 | + $username=new Question('Please enter your Magento username (public key): ', ''); |
|
| 162 | + $this->_m2Username=$helper->ask($input, $output, $username); |
|
| 163 | 163 | |
| 164 | - $password = new Question('Please enter your Magento password (private key): ', ''); |
|
| 165 | - $this->_m2Password = $helper->ask($input, $output, $password); |
|
| 164 | + $password=new Question('Please enter your Magento password (private key): ', ''); |
|
| 165 | + $this->_m2Password=$helper->ask($input, $output, $password); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /** |
@@ -174,12 +174,12 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) |
| 176 | 176 | { |
| 177 | - $authFile = $_SERVER['HOME'].'/.composer/auth.json'; |
|
| 177 | + $authFile=$_SERVER['HOME'].'/.composer/auth.json'; |
|
| 178 | 178 | |
| 179 | - $authObj = []; |
|
| 179 | + $authObj=[]; |
|
| 180 | 180 | if (file_exists($authFile)) { |
| 181 | - $authJson = file_get_contents($authFile); |
|
| 182 | - $authObj = (array) json_decode($authJson); |
|
| 181 | + $authJson=file_get_contents($authFile); |
|
| 182 | + $authObj=(array) json_decode($authJson); |
|
| 183 | 183 | |
| 184 | 184 | if (isset($authObj['http-basic']) && isset($authObj['http-basic']->{'repo.magento.com'})) { |
| 185 | 185 | return true; |
@@ -188,10 +188,10 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | $this->askForAuth($helper, $input, $output); |
| 190 | 190 | |
| 191 | - $authObj['http-basic']['repo.magento.com']['username'] = $this->_m2Username; |
|
| 192 | - $authObj['http-basic']['repo.magento.com']['password'] = $this->_m2Password; |
|
| 191 | + $authObj['http-basic']['repo.magento.com']['username']=$this->_m2Username; |
|
| 192 | + $authObj['http-basic']['repo.magento.com']['password']=$this->_m2Password; |
|
| 193 | 193 | |
| 194 | - $authJson = json_encode($authObj); |
|
| 194 | + $authJson=json_encode($authObj); |
|
| 195 | 195 | |
| 196 | 196 | return file_put_contents($authFile, $authJson); |
| 197 | 197 | } |
@@ -204,13 +204,13 @@ discard block |
||
| 204 | 204 | protected function setPhp($helper, InputInterface $input, OutputInterface $output) |
| 205 | 205 | { |
| 206 | 206 | $output->writeln('<info>Keep in mind PHP7 is only available for Magento 2</info>'); |
| 207 | - $phpVerQuestion = new ChoiceQuestion( |
|
| 207 | + $phpVerQuestion=new ChoiceQuestion( |
|
| 208 | 208 | 'Which version of PHP should be installed?', |
| 209 | 209 | ['56', '70'], |
| 210 | 210 | 0 |
| 211 | 211 | ); |
| 212 | 212 | |
| 213 | - $this->_phpVer = $helper->ask($input, $output, $phpVerQuestion); |
|
| 213 | + $this->_phpVer=$helper->ask($input, $output, $phpVerQuestion); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | /** |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | protected function setVagrantBox() |
| 220 | 220 | { |
| 221 | - $this->_box = self::BOX_PREFIX.$this->_os."-$this->_server-php$this->_phpVer"; |
|
| 221 | + $this->_box=self::BOX_PREFIX.$this->_os."-$this->_server-php$this->_phpVer"; |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
@@ -241,13 +241,13 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | protected function setWebServer($helper, InputInterface $input, OutputInterface $output) |
| 243 | 243 | { |
| 244 | - $serverQuestion = new ChoiceQuestion( |
|
| 244 | + $serverQuestion=new ChoiceQuestion( |
|
| 245 | 245 | 'Which webserver would you like?', |
| 246 | 246 | ['NGINX', 'Apache'], |
| 247 | 247 | 0 |
| 248 | 248 | ); |
| 249 | 249 | |
| 250 | - $this->_server = strtolower($helper->ask($input, $output, $serverQuestion)); |
|
| 250 | + $this->_server=strtolower($helper->ask($input, $output, $serverQuestion)); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | /** |
@@ -257,12 +257,12 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) |
| 259 | 259 | { |
| 260 | - $osQuestion = new ChoiceQuestion( |
|
| 260 | + $osQuestion=new ChoiceQuestion( |
|
| 261 | 261 | 'Which OS would you like to install?', |
| 262 | 262 | ['CentOS 6.5', 'Ubuntu 14'], |
| 263 | 263 | 0 |
| 264 | 264 | ); |
| 265 | 265 | |
| 266 | - $this->_os = str_replace(' ', '', str_replace('.', '', strtolower($helper->ask($input, $output, $osQuestion)))); |
|
| 266 | + $this->_os=str_replace(' ', '', str_replace('.', '', strtolower($helper->ask($input, $output, $osQuestion)))); |
|
| 267 | 267 | } |
| 268 | 268 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | return $this->verifyAuth($helper, $input, $output); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - return true; |
|
| 136 | + return TRUE; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
| 145 | 145 | { |
| 146 | - $versionControl = new ConfirmationQuestion('Would you like to add your project to GIT? (no/yes) ', false); |
|
| 146 | + $versionControl = new ConfirmationQuestion('Would you like to add your project to GIT? (no/yes) ', FALSE); |
|
| 147 | 147 | $versioning = $helper->ask($input, $output, $versionControl); |
| 148 | 148 | if ($versioning) { |
| 149 | 149 | $repoQuestion = new Question('Enter your full GitHub/BitBucket repo URL: ', ''); |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $authObj = (array) json_decode($authJson); |
| 183 | 183 | |
| 184 | 184 | if (isset($authObj['http-basic']) && isset($authObj['http-basic']->{'repo.magento.com'})) { |
| 185 | - return true; |
|
| 185 | + return TRUE; |
|
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | |
@@ -50,12 +50,12 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | protected function installMagento(array $options, $projectPath, OutputInterface $output) |
| 52 | 52 | { |
| 53 | - $locale = $options['magestead']['apps']['mba_12345']['locale']; |
|
| 54 | - $db_name = $options['magestead']['apps']['mba_12345']['db_name']; |
|
| 55 | - $base_url = $options['magestead']['apps']['mba_12345']['base_url']; |
|
| 56 | - $default_currency = $options['magestead']['apps']['mba_12345']['default_currency']; |
|
| 53 | + $locale=$options['magestead']['apps']['mba_12345']['locale']; |
|
| 54 | + $db_name=$options['magestead']['apps']['mba_12345']['db_name']; |
|
| 55 | + $base_url=$options['magestead']['apps']['mba_12345']['base_url']; |
|
| 56 | + $default_currency=$options['magestead']['apps']['mba_12345']['default_currency']; |
|
| 57 | 57 | |
| 58 | - $install = 'vagrant ssh -c \'cd /var/www/public; php -f install.php -- \ |
|
| 58 | + $install='vagrant ssh -c \'cd /var/www/public; php -f install.php -- \ |
|
| 59 | 59 | --license_agreement_accepted "yes" \ |
| 60 | 60 | --locale "'.$locale.'" \ |
| 61 | 61 | --timezone "Europe/London" \ |
@@ -90,27 +90,27 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | protected function setPermissions($projectPath, OutputInterface $output) |
| 92 | 92 | { |
| 93 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo find var/ -type f -exec chmod 600 {} \;\''; |
|
| 93 | + $command='vagrant ssh -c \'cd /var/www/public; sudo find var/ -type f -exec chmod 600 {} \;\''; |
|
| 94 | 94 | $output->writeln('<comment>Setting "var" Files Permissions</comment>'); |
| 95 | 95 | new ProcessCommand($command, $projectPath, $output); |
| 96 | 96 | |
| 97 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo find media/ -type f -exec chmod 600 {} \;\''; |
|
| 97 | + $command='vagrant ssh -c \'cd /var/www/public; sudo find media/ -type f -exec chmod 600 {} \;\''; |
|
| 98 | 98 | $output->writeln('<comment>Setting "media" Files Permissions</comment>'); |
| 99 | 99 | new ProcessCommand($command, $projectPath, $output); |
| 100 | 100 | |
| 101 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo find var/ -type d -exec chmod 700 {} \;\''; |
|
| 101 | + $command='vagrant ssh -c \'cd /var/www/public; sudo find var/ -type d -exec chmod 700 {} \;\''; |
|
| 102 | 102 | $output->writeln('<comment>Setting "var" Folder Permissions</comment>'); |
| 103 | 103 | new ProcessCommand($command, $projectPath, $output); |
| 104 | 104 | |
| 105 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo find media/ -type d -exec chmod 700 {} \;\''; |
|
| 105 | + $command='vagrant ssh -c \'cd /var/www/public; sudo find media/ -type d -exec chmod 700 {} \;\''; |
|
| 106 | 106 | $output->writeln('<comment>Setting "media" Folder Permissions</comment>'); |
| 107 | 107 | new ProcessCommand($command, $projectPath, $output); |
| 108 | 108 | |
| 109 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 700 includes;\''; |
|
| 109 | + $command='vagrant ssh -c \'cd /var/www/public; sudo chmod 700 includes;\''; |
|
| 110 | 110 | $output->writeln('<comment>Setting "includes" Permissions</comment>'); |
| 111 | 111 | new ProcessCommand($command, $projectPath, $output); |
| 112 | 112 | |
| 113 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 600 includes/config.php;\''; |
|
| 113 | + $command='vagrant ssh -c \'cd /var/www/public; sudo chmod 600 includes/config.php;\''; |
|
| 114 | 114 | $output->writeln('<comment>Setting "includes/config.php" Permissions</comment>'); |
| 115 | 115 | new ProcessCommand($command, $projectPath, $output); |
| 116 | 116 | } |
@@ -121,11 +121,11 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | protected function installMagerun($projectPath, OutputInterface $output) |
| 123 | 123 | { |
| 124 | - $command = 'vagrant ssh -c \'cd /var/www/bin; sudo wget https://files.magerun.net/n98-magerun.phar;\''; |
|
| 124 | + $command='vagrant ssh -c \'cd /var/www/bin; sudo wget https://files.magerun.net/n98-magerun.phar;\''; |
|
| 125 | 125 | $output->writeln('<info>Downloading Magerun</info>'); |
| 126 | 126 | new ProcessCommand($command, $projectPath, $output); |
| 127 | 127 | |
| 128 | - $command = 'vagrant ssh -c \'cd /var/www/bin; sudo chmod +x ./n98-magerun.phar;\''; |
|
| 128 | + $command='vagrant ssh -c \'cd /var/www/bin; sudo chmod +x ./n98-magerun.phar;\''; |
|
| 129 | 129 | $output->writeln('<comment>Setting Magerun Permissions</comment>'); |
| 130 | 130 | new ProcessCommand($command, $projectPath, $output); |
| 131 | 131 | } |
@@ -137,21 +137,21 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) |
| 139 | 139 | { |
| 140 | - $command = 'vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar index:reindex:all;\''; |
|
| 140 | + $command='vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar index:reindex:all;\''; |
|
| 141 | 141 | $output->writeln('<comment>Reindexing Tables</comment>'); |
| 142 | 142 | new ProcessCommand($command, $projectPath, $output); |
| 143 | 143 | |
| 144 | - $command = 'vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar cache:enable;\''; |
|
| 144 | + $command='vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar cache:enable;\''; |
|
| 145 | 145 | $output->writeln('<comment>Enabling All Cache</comment>'); |
| 146 | 146 | new ProcessCommand($command, $projectPath, $output); |
| 147 | 147 | |
| 148 | - $command = 'vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar cache:flush;\''; |
|
| 148 | + $command='vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar cache:flush;\''; |
|
| 149 | 149 | $output->writeln('<comment>Flushing All Cache</comment>'); |
| 150 | 150 | new ProcessCommand($command, $projectPath, $output); |
| 151 | 151 | |
| 152 | 152 | $this->processVcs($options, $projectPath, $output); |
| 153 | 153 | |
| 154 | - $command = 'vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar sys:check;\''; |
|
| 154 | + $command='vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar sys:check;\''; |
|
| 155 | 155 | $output->writeln('<comment>System Check</comment>'); |
| 156 | 156 | new ProcessCommand($command, $projectPath, $output); |
| 157 | 157 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | protected function showCredentials(array $options, OutputInterface $output) |
| 164 | 164 | { |
| 165 | 165 | $output->writeln('<info>SUCCESS: Magestead has finished installing Magento!</info>'); |
| 166 | - $table = new Table($output); |
|
| 166 | + $table=new Table($output); |
|
| 167 | 167 | $table |
| 168 | 168 | ->setHeaders(['Username', 'Password', 'Base URL']) |
| 169 | 169 | ->setRows([ |
@@ -214,29 +214,29 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | protected function updateConfigXml($projectPath) |
| 216 | 216 | { |
| 217 | - $localFile = '/public/app/etc/local.xml'; |
|
| 218 | - $localXml = file_get_contents($projectPath.$localFile); |
|
| 219 | - |
|
| 220 | - $config = new \SimpleXMLElement($localXml); |
|
| 221 | - |
|
| 222 | - $config->global[0]->redis_session[0]->host = '127.0.0.1'; |
|
| 223 | - $config->global[0]->redis_session[0]->port = '6379'; |
|
| 224 | - $config->global[0]->redis_session[0]->password = ''; |
|
| 225 | - $config->global[0]->redis_session[0]->timeout = '2.5'; |
|
| 226 | - $config->global[0]->redis_session[0]->persistent = ''; |
|
| 227 | - $config->global[0]->redis_session[0]->db = ''; |
|
| 228 | - $config->global[0]->redis_session[0]->compression_threshold = '2048'; |
|
| 229 | - $config->global[0]->redis_session[0]->compression_lib = 'gzip'; |
|
| 230 | - $config->global[0]->redis_session[0]->log_level = '1'; |
|
| 231 | - $config->global[0]->redis_session[0]->max_concurrency = '6'; |
|
| 232 | - $config->global[0]->redis_session[0]->break_after_frontend = '5'; |
|
| 233 | - $config->global[0]->redis_session[0]->break_after_adminhtml = '30'; |
|
| 234 | - $config->global[0]->redis_session[0]->first_lifetime = '600'; |
|
| 235 | - $config->global[0]->redis_session[0]->bot_first_lifetime = '60'; |
|
| 236 | - $config->global[0]->redis_session[0]->bot_lifetime = '7200'; |
|
| 237 | - $config->global[0]->redis_session[0]->disable_locking = '0'; |
|
| 238 | - $config->global[0]->redis_session[0]->min_lifetime = '60'; |
|
| 239 | - $config->global[0]->redis_session[0]->max_lifetime = '2592000'; |
|
| 217 | + $localFile='/public/app/etc/local.xml'; |
|
| 218 | + $localXml=file_get_contents($projectPath.$localFile); |
|
| 219 | + |
|
| 220 | + $config=new \SimpleXMLElement($localXml); |
|
| 221 | + |
|
| 222 | + $config->global[0]->redis_session[0]->host='127.0.0.1'; |
|
| 223 | + $config->global[0]->redis_session[0]->port='6379'; |
|
| 224 | + $config->global[0]->redis_session[0]->password=''; |
|
| 225 | + $config->global[0]->redis_session[0]->timeout='2.5'; |
|
| 226 | + $config->global[0]->redis_session[0]->persistent=''; |
|
| 227 | + $config->global[0]->redis_session[0]->db=''; |
|
| 228 | + $config->global[0]->redis_session[0]->compression_threshold='2048'; |
|
| 229 | + $config->global[0]->redis_session[0]->compression_lib='gzip'; |
|
| 230 | + $config->global[0]->redis_session[0]->log_level='1'; |
|
| 231 | + $config->global[0]->redis_session[0]->max_concurrency='6'; |
|
| 232 | + $config->global[0]->redis_session[0]->break_after_frontend='5'; |
|
| 233 | + $config->global[0]->redis_session[0]->break_after_adminhtml='30'; |
|
| 234 | + $config->global[0]->redis_session[0]->first_lifetime='600'; |
|
| 235 | + $config->global[0]->redis_session[0]->bot_first_lifetime='60'; |
|
| 236 | + $config->global[0]->redis_session[0]->bot_lifetime='7200'; |
|
| 237 | + $config->global[0]->redis_session[0]->disable_locking='0'; |
|
| 238 | + $config->global[0]->redis_session[0]->min_lifetime='60'; |
|
| 239 | + $config->global[0]->redis_session[0]->max_lifetime='2592000'; |
|
| 240 | 240 | |
| 241 | 241 | file_put_contents($projectPath.$localFile, $config->asXML()); |
| 242 | 242 | } |
@@ -246,11 +246,11 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | protected function activateModule($projectPath) |
| 248 | 248 | { |
| 249 | - $moduleFile = '/public/app/etc/modules/Cm_RedisSession.xml'; |
|
| 250 | - $moduleXml = file_get_contents($projectPath.$moduleFile); |
|
| 251 | - $config = new \SimpleXMLElement($moduleXml); |
|
| 249 | + $moduleFile='/public/app/etc/modules/Cm_RedisSession.xml'; |
|
| 250 | + $moduleXml=file_get_contents($projectPath.$moduleFile); |
|
| 251 | + $config=new \SimpleXMLElement($moduleXml); |
|
| 252 | 252 | |
| 253 | - $config->modules[0]->Cm_RedisSession[0]->active = 'true'; |
|
| 253 | + $config->modules[0]->Cm_RedisSession[0]->active='true'; |
|
| 254 | 254 | file_put_contents($projectPath.$moduleFile, $config->asXML()); |
| 255 | 255 | } |
| 256 | 256 | |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | protected function configureTestSuites(array $options, $projectPath, OutputInterface $output) |
| 265 | 265 | { |
| 266 | 266 | $output->writeln('<info>Configuring PHPSpec & Behat Suites</info>'); |
| 267 | - $progress = new ProgressBar($output, 2); |
|
| 267 | + $progress=new ProgressBar($output, 2); |
|
| 268 | 268 | |
| 269 | 269 | $progress->start(); |
| 270 | 270 | copy($projectPath.'/puphpet/magestead/magento/stubs/phpspec.yml', $projectPath.'/phpspec.yml'); |
@@ -288,12 +288,12 @@ discard block |
||
| 288 | 288 | */ |
| 289 | 289 | protected function getBehatConfig(array $options, $projectPath, OutputInterface $output) |
| 290 | 290 | { |
| 291 | - $yaml = new Parser(); |
|
| 291 | + $yaml=new Parser(); |
|
| 292 | 292 | |
| 293 | 293 | try { |
| 294 | - $behat = $yaml->parse(file_get_contents($projectPath.'/puphpet/magestead/magento/stubs/behat.yml')); |
|
| 294 | + $behat=$yaml->parse(file_get_contents($projectPath.'/puphpet/magestead/magento/stubs/behat.yml')); |
|
| 295 | 295 | |
| 296 | - $behat['default']['extensions']['MageTest\MagentoExtension\Extension']['base_url'] = $options['base_url']; |
|
| 296 | + $behat['default']['extensions']['MageTest\MagentoExtension\Extension']['base_url']=$options['base_url']; |
|
| 297 | 297 | |
| 298 | 298 | return $behat; |
| 299 | 299 | } catch (ParseException $e) { |
@@ -311,8 +311,8 @@ discard block |
||
| 311 | 311 | */ |
| 312 | 312 | protected function saveBehatConfig($projectPath, OutputInterface $output, $behat, $progress) |
| 313 | 313 | { |
| 314 | - $dumper = new Dumper(); |
|
| 315 | - $yaml = $dumper->dump($behat, 6); |
|
| 314 | + $dumper=new Dumper(); |
|
| 315 | + $yaml=$dumper->dump($behat, 6); |
|
| 316 | 316 | |
| 317 | 317 | try { |
| 318 | 318 | file_put_contents($projectPath.'/behat.yml', $yaml); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | protected function composerInstall($projectPath, OutputInterface $output) |
| 40 | 40 | { |
| 41 | 41 | $output->writeln('<info>Installing Magento 2 with Composer</info>'); |
| 42 | - $command = 'composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition public'; |
|
| 42 | + $command='composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition public'; |
|
| 43 | 43 | new ProcessCommand($command, $projectPath, $output); |
| 44 | 44 | |
| 45 | 45 | $this->setComposerBinDir($projectPath); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | protected function addPhpSpecPackage($projectPath, OutputInterface $output) |
| 55 | 55 | { |
| 56 | 56 | $output->writeln('<comment>Installing PHPSpec</comment>'); |
| 57 | - $command = 'cd '.$projectPath.'/public; composer require phpspec/phpspec --dev;'; |
|
| 57 | + $command='cd '.$projectPath.'/public; composer require phpspec/phpspec --dev;'; |
|
| 58 | 58 | new ProcessCommand($command, $projectPath, $output); |
| 59 | 59 | |
| 60 | 60 | $this->setPhpSpecPermissions($projectPath, $output); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | protected function addBehatPackage($projectPath, OutputInterface $output) |
| 68 | 68 | { |
| 69 | 69 | $output->writeln('<comment>Installing Behat</comment>'); |
| 70 | - $command = 'cd '.$projectPath.'/public; composer require behat/behat --dev;'; |
|
| 70 | + $command='cd '.$projectPath.'/public; composer require behat/behat --dev;'; |
|
| 71 | 71 | new ProcessCommand($command, $projectPath, $output); |
| 72 | 72 | |
| 73 | 73 | $this->setBehatPermissions($projectPath, $output); |
@@ -83,12 +83,12 @@ discard block |
||
| 83 | 83 | $this->setPermissions($projectPath, $output); |
| 84 | 84 | |
| 85 | 85 | $output->writeln('<info>Installing Magento 2 Software</info>'); |
| 86 | - $locale = $options['magestead']['apps']['mba_12345']['locale']; |
|
| 87 | - $db_name = $options['magestead']['apps']['mba_12345']['db_name']; |
|
| 88 | - $base_url = $options['magestead']['apps']['mba_12345']['base_url']; |
|
| 89 | - $default_currency = $options['magestead']['apps']['mba_12345']['default_currency']; |
|
| 86 | + $locale=$options['magestead']['apps']['mba_12345']['locale']; |
|
| 87 | + $db_name=$options['magestead']['apps']['mba_12345']['db_name']; |
|
| 88 | + $base_url=$options['magestead']['apps']['mba_12345']['base_url']; |
|
| 89 | + $default_currency=$options['magestead']['apps']['mba_12345']['default_currency']; |
|
| 90 | 90 | |
| 91 | - $install = 'vagrant ssh -c \'cd /var/www/public; bin/magento setup:install --base-url=http://'.$base_url.'/ \ |
|
| 91 | + $install='vagrant ssh -c \'cd /var/www/public; bin/magento setup:install --base-url=http://'.$base_url.'/ \ |
|
| 92 | 92 | --db-host=localhost \ |
| 93 | 93 | --db-name='.$db_name.' \ |
| 94 | 94 | --db-user=magestead \ |
@@ -115,15 +115,15 @@ discard block |
||
| 115 | 115 | protected function setPermissions($projectPath, OutputInterface $output) |
| 116 | 116 | { |
| 117 | 117 | $output->writeln('<info>Setting Permissions</info>'); |
| 118 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo find . -type d -exec chmod 700 {} \;\''; |
|
| 118 | + $command='vagrant ssh -c \'cd /var/www/public; sudo find . -type d -exec chmod 700 {} \;\''; |
|
| 119 | 119 | new ProcessCommand($command, $projectPath, $output); |
| 120 | 120 | $output->writeln('<comment>Folder Permissions Set</comment>'); |
| 121 | 121 | |
| 122 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo find . -type f -exec chmod 600 {} \;\''; |
|
| 122 | + $command='vagrant ssh -c \'cd /var/www/public; sudo find . -type f -exec chmod 600 {} \;\''; |
|
| 123 | 123 | new ProcessCommand($command, $projectPath, $output); |
| 124 | 124 | $output->writeln('<comment>File Permissions Set</comment>'); |
| 125 | 125 | |
| 126 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod +x bin/magento; sudo chmod 755 bin/phpspec; sudo chmod 755 bin/behat;\''; |
|
| 126 | + $command='vagrant ssh -c \'cd /var/www/public; sudo chmod +x bin/magento; sudo chmod 755 bin/phpspec; sudo chmod 755 bin/behat;\''; |
|
| 127 | 127 | new ProcessCommand($command, $projectPath, $output); |
| 128 | 128 | $output->writeln('<comment>bin/magento Permissions Set</comment>'); |
| 129 | 129 | } |
@@ -135,10 +135,10 @@ discard block |
||
| 135 | 135 | protected function configureRedis($projectPath, OutputInterface $output) |
| 136 | 136 | { |
| 137 | 137 | $output->writeln('<comment>Configuring Redis Cache</comment>'); |
| 138 | - $file = "$projectPath/public/app/etc/env.php"; |
|
| 139 | - $env = include $file; |
|
| 138 | + $file="$projectPath/public/app/etc/env.php"; |
|
| 139 | + $env=include $file; |
|
| 140 | 140 | |
| 141 | - $env['cache'] = [ |
|
| 141 | + $env['cache']=[ |
|
| 142 | 142 | 'frontend' => [ |
| 143 | 143 | 'default' => [ |
| 144 | 144 | 'backend' => 'Cm_Cache_Backend_Redis', |
@@ -187,11 +187,11 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) |
| 189 | 189 | { |
| 190 | - $command = 'vagrant ssh -c \'cd /var/www/public; bin/magento indexer:reindex; \''; |
|
| 190 | + $command='vagrant ssh -c \'cd /var/www/public; bin/magento indexer:reindex; \''; |
|
| 191 | 191 | $output->writeln('<comment>Reindexing Tables</comment>'); |
| 192 | 192 | new ProcessCommand($command, $projectPath, $output); |
| 193 | 193 | |
| 194 | - $command = 'vagrant ssh -c \'cd /var/www/public; bin/magento cache:flush;\''; |
|
| 194 | + $command='vagrant ssh -c \'cd /var/www/public; bin/magento cache:flush;\''; |
|
| 195 | 195 | $output->writeln('<comment>Flushing All Cache</comment>'); |
| 196 | 196 | new ProcessCommand($command, $projectPath, $output); |
| 197 | 197 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | protected function showCredentials(array $options, OutputInterface $output) |
| 207 | 207 | { |
| 208 | 208 | $output->writeln('<info>SUCCESS: Magestead has finished installing Magento 2!</info>'); |
| 209 | - $table = new Table($output); |
|
| 209 | + $table=new Table($output); |
|
| 210 | 210 | $table |
| 211 | 211 | ->setHeaders(['Username', 'Password', 'Base URL', 'Admin URI']) |
| 212 | 212 | ->setRows([ |
@@ -238,10 +238,10 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | protected function setComposerBinDir($projectPath) |
| 240 | 240 | { |
| 241 | - $file = "$projectPath/public/composer.json"; |
|
| 242 | - $composer = json_decode(file_get_contents($file), true); |
|
| 241 | + $file="$projectPath/public/composer.json"; |
|
| 242 | + $composer=json_decode(file_get_contents($file), true); |
|
| 243 | 243 | |
| 244 | - $composer['config']['bin-dir'] = 'bin'; |
|
| 244 | + $composer['config']['bin-dir']='bin'; |
|
| 245 | 245 | file_put_contents($file, json_encode($composer)); |
| 246 | 246 | } |
| 247 | 247 | |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | */ |
| 252 | 252 | protected function setPhpSpecPermissions($projectPath, OutputInterface $output) |
| 253 | 253 | { |
| 254 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/phpspec; bin/phpspec run\''; |
|
| 254 | + $command='vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/phpspec; bin/phpspec run\''; |
|
| 255 | 255 | new ProcessCommand($command, $projectPath, $output); |
| 256 | 256 | } |
| 257 | 257 | |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | */ |
| 262 | 262 | protected function setBehatPermissions($projectPath, OutputInterface $output) |
| 263 | 263 | { |
| 264 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/behat; bin/behat --init\''; |
|
| 264 | + $command='vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/behat; bin/behat --init\''; |
|
| 265 | 265 | new ProcessCommand($command, $projectPath, $output); |
| 266 | 266 | } |
| 267 | 267 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | ], |
| 178 | 178 | ]; |
| 179 | 179 | |
| 180 | - file_put_contents($file, "<?php \n \n return ".var_export($env, true).';'); |
|
| 180 | + file_put_contents($file, "<?php \n \n return ".var_export($env, TRUE).';'); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /** |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | protected function setComposerBinDir($projectPath) |
| 240 | 240 | { |
| 241 | 241 | $file = "$projectPath/public/composer.json"; |
| 242 | - $composer = json_decode(file_get_contents($file), true); |
|
| 242 | + $composer = json_decode(file_get_contents($file), TRUE); |
|
| 243 | 243 | |
| 244 | 244 | $composer['config']['bin-dir'] = 'bin'; |
| 245 | 245 | file_put_contents($file, json_encode($composer)); |