@@ -4,4 +4,6 @@ |
||
| 4 | 4 | * Class ExistingProjectException |
| 5 | 5 | * @package Magestead\Exceptions |
| 6 | 6 | */ |
| 7 | -class ExistingProjectException extends \Exception {} |
|
| 8 | 7 | \ No newline at end of file |
| 8 | +class ExistingProjectException extends \Exception |
|
| 9 | +{ |
|
| 10 | +} |
|
| 9 | 11 | \ No newline at end of file |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | protected $_projectPath; |
| 23 | 23 | protected $_msConfig; |
| 24 | 24 | |
| 25 | - protected function configure() |
|
| 26 | - { |
|
| 25 | + protected function configure() { |
|
| 27 | 26 | $this->_basePath = dirname( __FILE__ ) . '/../../../'; |
| 28 | 27 | $this->_projectPath = getcwd(); |
| 29 | 28 | |
@@ -39,8 +38,7 @@ discard block |
||
| 39 | 38 | * @return \Magestead\Installers\Magento2Project|\Magestead\Installers\MagentoProject |
| 40 | 39 | * @throws ExistingProjectException |
| 41 | 40 | */ |
| 42 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 43 | - { |
|
| 41 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 44 | 42 | $project = $this->setProject($input); |
| 45 | 43 | |
| 46 | 44 | $helper = $this->getHelper('question'); |
@@ -59,8 +57,7 @@ discard block |
||
| 59 | 57 | * @param $target |
| 60 | 58 | * @param OutputInterface $output |
| 61 | 59 | */ |
| 62 | - protected function copyConfigFiles($source, $target, OutputInterface $output) |
|
| 63 | - { |
|
| 60 | + protected function copyConfigFiles($source, $target, OutputInterface $output) { |
|
| 64 | 61 | try { |
| 65 | 62 | $progress = new ProgressBar($output, 3720); |
| 66 | 63 | $progress->start(); |
@@ -87,8 +84,7 @@ discard block |
||
| 87 | 84 | * @param array $options |
| 88 | 85 | * @param OutputInterface $output |
| 89 | 86 | */ |
| 90 | - protected function configureProject(array $options, OutputInterface $output) |
|
| 91 | - { |
|
| 87 | + protected function configureProject(array $options, OutputInterface $output) { |
|
| 92 | 88 | $msConfig = $this->getConfigFile($output); |
| 93 | 89 | |
| 94 | 90 | $app = ($options['app'] == 'magento2') ? 'magento2' : 'magento'; |
@@ -116,8 +112,7 @@ discard block |
||
| 116 | 112 | * @param OutputInterface $output |
| 117 | 113 | * @return mixed |
| 118 | 114 | */ |
| 119 | - protected function getConfigFile(OutputInterface $output) |
|
| 120 | - { |
|
| 115 | + protected function getConfigFile(OutputInterface $output) { |
|
| 121 | 116 | $yaml = new Parser(); |
| 122 | 117 | try { |
| 123 | 118 | return $yaml->parse(file_get_contents($this->_projectPath . '/magestead.yaml')); |
@@ -131,8 +126,7 @@ discard block |
||
| 131 | 126 | * @param array $config |
| 132 | 127 | * @param OutputInterface $output |
| 133 | 128 | */ |
| 134 | - protected function saveConfigFile(array $config, OutputInterface $output) |
|
| 135 | - { |
|
| 129 | + protected function saveConfigFile(array $config, OutputInterface $output) { |
|
| 136 | 130 | $dumper = new Dumper(); |
| 137 | 131 | $yaml = $dumper->dump($config, 6); |
| 138 | 132 | |
@@ -147,8 +141,7 @@ discard block |
||
| 147 | 141 | * @param OutputInterface $output |
| 148 | 142 | * @param $options |
| 149 | 143 | */ |
| 150 | - protected function setupProject(OutputInterface $output, $options) |
|
| 151 | - { |
|
| 144 | + protected function setupProject(OutputInterface $output, $options) { |
|
| 152 | 145 | $output->writeln('<info>Setting up project structure</info>'); |
| 153 | 146 | $provisionFolder = $this->_basePath . "provision"; |
| 154 | 147 | $this->copyConfigFiles($provisionFolder, $this->_projectPath, $output); |
@@ -160,8 +153,7 @@ discard block |
||
| 160 | 153 | * @return mixed |
| 161 | 154 | * @throws ExistingProjectException |
| 162 | 155 | */ |
| 163 | - protected function setProject(InputInterface $input) |
|
| 164 | - { |
|
| 156 | + protected function setProject(InputInterface $input) { |
|
| 165 | 157 | $project = $input->getArgument('project'); |
| 166 | 158 | $this->_projectPath = $this->_projectPath . '/' . $project; |
| 167 | 159 | |
@@ -170,7 +170,7 @@ |
||
| 170 | 170 | throw new ExistingProjectException('Target project directory already exists'); |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - mkdir($this->_projectPath, 0777, true); |
|
| 173 | + mkdir($this->_projectPath, 0777, TRUE); |
|
| 174 | 174 | return $project; |
| 175 | 175 | } |
| 176 | 176 | } |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | protected function configure() |
| 27 | 27 | { |
| 28 | - $this->_basePath = dirname( __FILE__ ) . '/../../../'; |
|
| 29 | - $this->_projectPath = getcwd(); |
|
| 28 | + $this->_basePath=dirname(__FILE__).'/../../../'; |
|
| 29 | + $this->_projectPath=getcwd(); |
|
| 30 | 30 | |
| 31 | 31 | $this->setName("new"); |
| 32 | 32 | $this->setDescription("Initialise new Magestead project into current working directory"); |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | protected function execute(InputInterface $input, OutputInterface $output) |
| 43 | 43 | { |
| 44 | - $project = $this->setProject($input); |
|
| 44 | + $project=$this->setProject($input); |
|
| 45 | 45 | |
| 46 | - $helper = $this->getHelper('question'); |
|
| 47 | - $options = (new Options($helper, $input, $output, $project))->getAllOptions(); |
|
| 46 | + $helper=$this->getHelper('question'); |
|
| 47 | + $options=(new Options($helper, $input, $output, $project))->getAllOptions(); |
|
| 48 | 48 | |
| 49 | 49 | $this->setupProject($output, $options); |
| 50 | 50 | |
@@ -62,17 +62,17 @@ discard block |
||
| 62 | 62 | protected function copyConfigFiles($source, $target, OutputInterface $output) |
| 63 | 63 | { |
| 64 | 64 | try { |
| 65 | - $progress = new ProgressBar($output, 3720); |
|
| 65 | + $progress=new ProgressBar($output, 3720); |
|
| 66 | 66 | $progress->start(); |
| 67 | 67 | foreach ( |
| 68 | - $iterator = new \RecursiveIteratorIterator( |
|
| 68 | + $iterator=new \RecursiveIteratorIterator( |
|
| 69 | 69 | new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS), |
| 70 | 70 | \RecursiveIteratorIterator::SELF_FIRST) as $item |
| 71 | 71 | ) { |
| 72 | 72 | if ($item->isDir()) { |
| 73 | - mkdir($target . DIRECTORY_SEPARATOR . $iterator->getSubPathName()); |
|
| 73 | + mkdir($target.DIRECTORY_SEPARATOR.$iterator->getSubPathName()); |
|
| 74 | 74 | } else { |
| 75 | - copy($item, $target . DIRECTORY_SEPARATOR . $iterator->getSubPathName()); |
|
| 75 | + copy($item, $target.DIRECTORY_SEPARATOR.$iterator->getSubPathName()); |
|
| 76 | 76 | } |
| 77 | 77 | $progress->advance(); |
| 78 | 78 | } |
@@ -89,24 +89,24 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | protected function configureProject(array $options, OutputInterface $output) |
| 91 | 91 | { |
| 92 | - $msConfig = $this->getConfigFile($output); |
|
| 92 | + $msConfig=$this->getConfigFile($output); |
|
| 93 | 93 | |
| 94 | - $app = ($options['app'] == 'magento2') ? 'magento2' : 'magento'; |
|
| 95 | - $hostname = 'magestead-' . $options['base_url']; |
|
| 94 | + $app=($options['app'] == 'magento2') ? 'magento2' : 'magento'; |
|
| 95 | + $hostname='magestead-'.$options['base_url']; |
|
| 96 | 96 | |
| 97 | - $msConfig['vagrantfile']['vm']['box'] = $options['box']; |
|
| 98 | - $msConfig['vagrantfile']['vm']['box_url'] = $options['box']; |
|
| 99 | - $msConfig['vagrantfile']['vm']['hostname'] = $hostname; |
|
| 100 | - $msConfig['vagrantfile']['vm']['memory'] = $options['memory_limit']; |
|
| 101 | - $msConfig['vagrantfile']['vm']['network']['private_network'] = $options['ip_address']; |
|
| 102 | - $msConfig['magestead']['apps']['mba_12345']['type'] = $app; |
|
| 103 | - $msConfig['magestead']['apps']['mba_12345']['locale'] = $options['locale']; |
|
| 104 | - $msConfig['magestead']['apps']['mba_12345']['default_currency'] = $options['default_currency']; |
|
| 105 | - $msConfig['magestead']['apps']['mba_12345']['base_url'] = $options['base_url']; |
|
| 106 | - $msConfig['magestead']['os'] = $options['os']; |
|
| 107 | - $msConfig['magestead']['server'] = $options['server']; |
|
| 97 | + $msConfig['vagrantfile']['vm']['box']=$options['box']; |
|
| 98 | + $msConfig['vagrantfile']['vm']['box_url']=$options['box']; |
|
| 99 | + $msConfig['vagrantfile']['vm']['hostname']=$hostname; |
|
| 100 | + $msConfig['vagrantfile']['vm']['memory']=$options['memory_limit']; |
|
| 101 | + $msConfig['vagrantfile']['vm']['network']['private_network']=$options['ip_address']; |
|
| 102 | + $msConfig['magestead']['apps']['mba_12345']['type']=$app; |
|
| 103 | + $msConfig['magestead']['apps']['mba_12345']['locale']=$options['locale']; |
|
| 104 | + $msConfig['magestead']['apps']['mba_12345']['default_currency']=$options['default_currency']; |
|
| 105 | + $msConfig['magestead']['apps']['mba_12345']['base_url']=$options['base_url']; |
|
| 106 | + $msConfig['magestead']['os']=$options['os']; |
|
| 107 | + $msConfig['magestead']['server']=$options['server']; |
|
| 108 | 108 | |
| 109 | - $this->_msConfig = $msConfig; |
|
| 109 | + $this->_msConfig=$msConfig; |
|
| 110 | 110 | |
| 111 | 111 | $this->saveConfigFile($msConfig, $output); |
| 112 | 112 | |
@@ -118,9 +118,9 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | protected function getConfigFile(OutputInterface $output) |
| 120 | 120 | { |
| 121 | - $yaml = new Parser(); |
|
| 121 | + $yaml=new Parser(); |
|
| 122 | 122 | try { |
| 123 | - return $yaml->parse(file_get_contents($this->_projectPath . '/magestead.yaml')); |
|
| 123 | + return $yaml->parse(file_get_contents($this->_projectPath.'/magestead.yaml')); |
|
| 124 | 124 | } catch (ParseException $e) { |
| 125 | 125 | $output->writeln('<error>Unable to parse the YAML string</error>'); |
| 126 | 126 | printf("Unable to parse the YAML string: %s", $e->getMessage()); |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | protected function saveConfigFile(array $config, OutputInterface $output) |
| 135 | 135 | { |
| 136 | - $dumper = new Dumper(); |
|
| 137 | - $yaml = $dumper->dump($config, 6); |
|
| 136 | + $dumper=new Dumper(); |
|
| 137 | + $yaml=$dumper->dump($config, 6); |
|
| 138 | 138 | |
| 139 | 139 | try { |
| 140 | - file_put_contents($this->_projectPath . '/magestead.yaml', $yaml); |
|
| 140 | + file_put_contents($this->_projectPath.'/magestead.yaml', $yaml); |
|
| 141 | 141 | } catch (\Exception $e) { |
| 142 | 142 | $output->writeln('<error>Unable to write to the YAML file</error>'); |
| 143 | 143 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | protected function setupProject(OutputInterface $output, $options) |
| 151 | 151 | { |
| 152 | 152 | $output->writeln('<info>Setting up project structure</info>'); |
| 153 | - $provisionFolder = $this->_basePath . "provision"; |
|
| 153 | + $provisionFolder=$this->_basePath."provision"; |
|
| 154 | 154 | $this->copyConfigFiles($provisionFolder, $this->_projectPath, $output); |
| 155 | 155 | $this->configureProject($options, $output); |
| 156 | 156 | |
@@ -164,8 +164,8 @@ discard block |
||
| 164 | 164 | */ |
| 165 | 165 | protected function setProject(InputInterface $input) |
| 166 | 166 | { |
| 167 | - $project = $input->getArgument('project'); |
|
| 168 | - $this->_projectPath = $this->_projectPath . '/' . $project; |
|
| 167 | + $project=$input->getArgument('project'); |
|
| 168 | + $this->_projectPath=$this->_projectPath.'/'.$project; |
|
| 169 | 169 | |
| 170 | 170 | |
| 171 | 171 | if (is_dir($this->_projectPath)) { |
@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | * UsageApi constructor. |
| 22 | 22 | * @param $data |
| 23 | 23 | */ |
| 24 | - public function __construct($data) |
|
| 25 | - { |
|
| 24 | + public function __construct($data) { |
|
| 26 | 25 | $this->_params['os_type'] = urlencode($data['os']); |
| 27 | 26 | $this->_params['server_type'] = urlencode($data['server']); |
| 28 | 27 | $this->_params['php_version'] = urlencode($data['phpver']); |
@@ -38,8 +37,7 @@ discard block |
||
| 38 | 37 | /** |
| 39 | 38 | * |
| 40 | 39 | */ |
| 41 | - public function send() |
|
| 42 | - { |
|
| 40 | + public function send() { |
|
| 43 | 41 | $fields_string = $this->getFieldsString(); |
| 44 | 42 | |
| 45 | 43 | $ch = curl_init(); |
@@ -58,8 +56,7 @@ discard block |
||
| 58 | 56 | /** |
| 59 | 57 | * @return string |
| 60 | 58 | */ |
| 61 | - protected function getFieldsString() |
|
| 62 | - { |
|
| 59 | + protected function getFieldsString() { |
|
| 63 | 60 | $fields_string = ''; |
| 64 | 61 | foreach ($this->_params as $key => $value) { |
| 65 | 62 | $fields_string .= $key . '=' . $value . '&'; |
@@ -9,13 +9,13 @@ discard block |
||
| 9 | 9 | /** |
| 10 | 10 | * @var string |
| 11 | 11 | */ |
| 12 | - protected $_apiUrl = "https://api.magestead.com/v1/usage"; |
|
| 12 | + protected $_apiUrl="https://api.magestead.com/v1/usage"; |
|
| 13 | 13 | // protected $_apiUrl = "http://magestead-api.app/v1/usage"; |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * @var array |
| 17 | 17 | */ |
| 18 | - protected $_params = []; |
|
| 18 | + protected $_params=[]; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * UsageApi constructor. |
@@ -23,16 +23,16 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function __construct($data) |
| 25 | 25 | { |
| 26 | - $this->_params['os_type'] = urlencode($data['os']); |
|
| 27 | - $this->_params['server_type'] = urlencode($data['server']); |
|
| 28 | - $this->_params['php_version'] = urlencode($data['phpver']); |
|
| 29 | - $this->_params['application_version'] = urlencode($data['app']); |
|
| 30 | - $this->_params['vm_memory_limit'] = urlencode($data['memory_limit']); |
|
| 31 | - $this->_params['vm_cpu_count'] = urlencode($data['cpus']); |
|
| 32 | - $this->_params['ip_address'] = urlencode($data['ip_address']); |
|
| 33 | - $this->_params['box'] = urlencode($data['box']); |
|
| 34 | - $this->_params['locale'] = urlencode($data['locale']); |
|
| 35 | - $this->_params['default_currency'] = urlencode($data['default_currency']); |
|
| 26 | + $this->_params['os_type']=urlencode($data['os']); |
|
| 27 | + $this->_params['server_type']=urlencode($data['server']); |
|
| 28 | + $this->_params['php_version']=urlencode($data['phpver']); |
|
| 29 | + $this->_params['application_version']=urlencode($data['app']); |
|
| 30 | + $this->_params['vm_memory_limit']=urlencode($data['memory_limit']); |
|
| 31 | + $this->_params['vm_cpu_count']=urlencode($data['cpus']); |
|
| 32 | + $this->_params['ip_address']=urlencode($data['ip_address']); |
|
| 33 | + $this->_params['box']=urlencode($data['box']); |
|
| 34 | + $this->_params['locale']=urlencode($data['locale']); |
|
| 35 | + $this->_params['default_currency']=urlencode($data['default_currency']); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -40,16 +40,16 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function send() |
| 42 | 42 | { |
| 43 | - $fields_string = $this->getFieldsString(); |
|
| 43 | + $fields_string=$this->getFieldsString(); |
|
| 44 | 44 | |
| 45 | - $ch = curl_init(); |
|
| 45 | + $ch=curl_init(); |
|
| 46 | 46 | |
| 47 | - curl_setopt($ch,CURLOPT_URL, $this->_apiUrl); |
|
| 48 | - curl_setopt($ch,CURLOPT_POST, count($this->_params)); |
|
| 49 | - curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); |
|
| 47 | + curl_setopt($ch, CURLOPT_URL, $this->_apiUrl); |
|
| 48 | + curl_setopt($ch, CURLOPT_POST, count($this->_params)); |
|
| 49 | + curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); |
|
| 50 | 50 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
| 51 | 51 | |
| 52 | - $result = curl_exec($ch); |
|
| 52 | + $result=curl_exec($ch); |
|
| 53 | 53 | |
| 54 | 54 | curl_close($ch); |
| 55 | 55 | |
@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | protected function getFieldsString() |
| 62 | 62 | { |
| 63 | - $fields_string = ''; |
|
| 63 | + $fields_string=''; |
|
| 64 | 64 | foreach ($this->_params as $key => $value) { |
| 65 | - $fields_string .= $key . '=' . $value . '&'; |
|
| 65 | + $fields_string.=$key.'='.$value.'&'; |
|
| 66 | 66 | } |
| 67 | 67 | rtrim($fields_string, '&'); |
| 68 | 68 | return $fields_string; |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | protected function configure() |
| 23 | 23 | { |
| 24 | - $this->_projectPath = getcwd(); |
|
| 24 | + $this->_projectPath=getcwd(); |
|
| 25 | 25 | $this->setName("log:stream"); |
| 26 | 26 | $this->setDescription("Stream a specific server log"); |
| 27 | 27 | $this->addArgument('log', InputArgument::REQUIRED, 'access or error'); |
@@ -34,15 +34,15 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | protected function execute(InputInterface $input, OutputInterface $output) |
| 36 | 36 | { |
| 37 | - $log = $input->getArgument('log'); |
|
| 37 | + $log=$input->getArgument('log'); |
|
| 38 | 38 | |
| 39 | - $output->writeln('<info>Streaming '. ucwords($log) . ' Log</info>'); |
|
| 40 | - $command = $this->getCommand(new Config($output), $log); |
|
| 39 | + $output->writeln('<info>Streaming '.ucwords($log).' Log</info>'); |
|
| 40 | + $command=$this->getCommand(new Config($output), $log); |
|
| 41 | 41 | if (!$command) { |
| 42 | 42 | return $output->writeln('<error>Command not available for this application</error>'); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 45 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 46 | 46 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | private function getCommand(Config $config, $log) |
| 55 | 55 | { |
| 56 | - $server = $config->_config['magestead']['server']; |
|
| 57 | - $os = $config->_config['magestead']['os']; |
|
| 56 | + $server=$config->_config['magestead']['server']; |
|
| 57 | + $os=$config->_config['magestead']['os']; |
|
| 58 | 58 | |
| 59 | - $location = $this->getLogLocation($server, $os); |
|
| 60 | - $command = 'tail -f /var/log/' . $location . '/' . $config->base_url . '-' . $log . '.log'; |
|
| 59 | + $location=$this->getLogLocation($server, $os); |
|
| 60 | + $command='tail -f /var/log/'.$location.'/'.$config->base_url.'-'.$log.'.log'; |
|
| 61 | 61 | |
| 62 | 62 | return $command; |
| 63 | 63 | } |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | private function getLogLocation($server, $os) |
| 71 | 71 | { |
| 72 | - $location = 'nginx'; |
|
| 72 | + $location='nginx'; |
|
| 73 | 73 | if ($server != 'nginx') { |
| 74 | - $location = ($os == 'ubuntu14') ? 'apache2' : 'httpd'; |
|
| 74 | + $location=($os == 'ubuntu14') ? 'apache2' : 'httpd'; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | return $location; |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | /** |
| 20 | 20 | * Configure the view command |
| 21 | 21 | */ |
| 22 | - protected function configure() |
|
| 23 | - { |
|
| 22 | + protected function configure() { |
|
| 24 | 23 | $this->_projectPath = getcwd(); |
| 25 | 24 | $this->setName("log:view"); |
| 26 | 25 | $this->setDescription("View a specific server log"); |
@@ -32,8 +31,7 @@ discard block |
||
| 32 | 31 | * @param OutputInterface $output |
| 33 | 32 | * @return ProcessCommand |
| 34 | 33 | */ |
| 35 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 36 | - { |
|
| 34 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 37 | 35 | $log = $input->getArgument('log'); |
| 38 | 36 | |
| 39 | 37 | $output->writeln('<info>Viewing '. ucwords($log) . ' Log</info>'); |
@@ -51,8 +49,7 @@ discard block |
||
| 51 | 49 | * @param $log |
| 52 | 50 | * @return string |
| 53 | 51 | */ |
| 54 | - private function getCommand(Config $config, $log) |
|
| 55 | - { |
|
| 52 | + private function getCommand(Config $config, $log) { |
|
| 56 | 53 | $server = $config->_config['magestead']['server']; |
| 57 | 54 | $os = $config->_config['magestead']['os']; |
| 58 | 55 | |
@@ -67,8 +64,7 @@ discard block |
||
| 67 | 64 | * @param $os |
| 68 | 65 | * @return string |
| 69 | 66 | */ |
| 70 | - private function getLogLocation($server, $os) |
|
| 71 | - { |
|
| 67 | + private function getLogLocation($server, $os) { |
|
| 72 | 68 | $location = 'nginx'; |
| 73 | 69 | if ($server != 'nginx') { |
| 74 | 70 | $location = ($os == 'ubuntu14') ? 'apache2' : 'httpd'; |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | protected function configure() |
| 23 | 23 | { |
| 24 | - $this->_projectPath = getcwd(); |
|
| 24 | + $this->_projectPath=getcwd(); |
|
| 25 | 25 | $this->setName("log:view"); |
| 26 | 26 | $this->setDescription("View a specific server log"); |
| 27 | 27 | $this->addArgument('log', InputArgument::REQUIRED, 'access or error'); |
@@ -34,15 +34,15 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | protected function execute(InputInterface $input, OutputInterface $output) |
| 36 | 36 | { |
| 37 | - $log = $input->getArgument('log'); |
|
| 37 | + $log=$input->getArgument('log'); |
|
| 38 | 38 | |
| 39 | - $output->writeln('<info>Viewing '. ucwords($log) . ' Log</info>'); |
|
| 40 | - $command = $this->getCommand(new Config($output), $log); |
|
| 39 | + $output->writeln('<info>Viewing '.ucwords($log).' Log</info>'); |
|
| 40 | + $command=$this->getCommand(new Config($output), $log); |
|
| 41 | 41 | if (!$command) { |
| 42 | 42 | return $output->writeln('<error>Command not available for this application</error>'); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
| 45 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
| 46 | 46 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | private function getCommand(Config $config, $log) |
| 55 | 55 | { |
| 56 | - $server = $config->_config['magestead']['server']; |
|
| 57 | - $os = $config->_config['magestead']['os']; |
|
| 56 | + $server=$config->_config['magestead']['server']; |
|
| 57 | + $os=$config->_config['magestead']['os']; |
|
| 58 | 58 | |
| 59 | - $location = $this->getLogLocation($server, $os); |
|
| 60 | - $command = 'cat /var/log/' . $location . '/' . $config->base_url . '-' . $log . '.log'; |
|
| 59 | + $location=$this->getLogLocation($server, $os); |
|
| 60 | + $command='cat /var/log/'.$location.'/'.$config->base_url.'-'.$log.'.log'; |
|
| 61 | 61 | |
| 62 | 62 | return $command; |
| 63 | 63 | } |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | private function getLogLocation($server, $os) |
| 71 | 71 | { |
| 72 | - $location = 'nginx'; |
|
| 72 | + $location='nginx'; |
|
| 73 | 73 | if ($server != 'nginx') { |
| 74 | - $location = ($os == 'ubuntu14') ? 'apache2' : 'httpd'; |
|
| 74 | + $location=($os == 'ubuntu14') ? 'apache2' : 'httpd'; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | return $location; |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | /** |
| 20 | 20 | * Configure the view command |
| 21 | 21 | */ |
| 22 | - protected function configure() |
|
| 23 | - { |
|
| 22 | + protected function configure() { |
|
| 24 | 23 | $this->_projectPath = getcwd(); |
| 25 | 24 | $this->setName("log:view"); |
| 26 | 25 | $this->setDescription("View a specific server log"); |
@@ -32,8 +31,7 @@ discard block |
||
| 32 | 31 | * @param OutputInterface $output |
| 33 | 32 | * @return ProcessCommand |
| 34 | 33 | */ |
| 35 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 36 | - { |
|
| 34 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 37 | 35 | $log = $input->getArgument('log'); |
| 38 | 36 | |
| 39 | 37 | $output->writeln('<info>Viewing '. ucwords($log) . ' Log</info>'); |
@@ -51,8 +49,7 @@ discard block |
||
| 51 | 49 | * @param $log |
| 52 | 50 | * @return string |
| 53 | 51 | */ |
| 54 | - private function getCommand(Config $config, $log) |
|
| 55 | - { |
|
| 52 | + private function getCommand(Config $config, $log) { |
|
| 56 | 53 | $server = $config->_config['magestead']['server']; |
| 57 | 54 | $os = $config->_config['magestead']['os']; |
| 58 | 55 | |
@@ -67,8 +64,7 @@ discard block |
||
| 67 | 64 | * @param $os |
| 68 | 65 | * @return string |
| 69 | 66 | */ |
| 70 | - private function getLogLocation($server, $os) |
|
| 71 | - { |
|
| 67 | + private function getLogLocation($server, $os) { |
|
| 72 | 68 | $location = 'nginx'; |
| 73 | 69 | if ($server != 'nginx') { |
| 74 | 70 | $location = ($os == 'ubuntu14') ? 'apache2' : 'httpd'; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | protected function installSampleData($options, $projectPath, OutputInterface $output) |
| 111 | 111 | { |
| 112 | - if (true === $options['installSampleData']) { |
|
| 112 | + if (TRUE === $options['installSampleData']) { |
|
| 113 | 113 | $output->writeln('<info>Installing Magento 2 Sample Data</info>'); |
| 114 | 114 | $command = 'vagrant ssh -c \'cd /var/www; php bin/magento sampledata:deploy'; |
| 115 | 115 | new ProcessCommand($command, $projectPath, $output); |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | ], |
| 186 | 186 | ]; |
| 187 | 187 | |
| 188 | - file_put_contents($file, "<?php \n \n return ".var_export($env,true).";"); |
|
| 188 | + file_put_contents($file, "<?php \n \n return ".var_export($env,TRUE).";"); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | protected function setComposerBinDir($projectPath) |
| 246 | 246 | { |
| 247 | 247 | $file = "$projectPath/public/composer.json"; |
| 248 | - $composer = json_decode(file_get_contents($file), true); |
|
| 248 | + $composer = json_decode(file_get_contents($file), TRUE); |
|
| 249 | 249 | |
| 250 | 250 | $composer['config']['bin-dir'] = 'bin'; |
| 251 | 251 | file_put_contents($file, json_encode($composer)); |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | * @param $projectPath |
| 21 | 21 | * @param OutputInterface $output |
| 22 | 22 | */ |
| 23 | - public function __construct(array $options, array $config, $projectPath, OutputInterface $output) |
|
| 24 | - { |
|
| 23 | + public function __construct(array $options, array $config, $projectPath, OutputInterface $output) { |
|
| 25 | 24 | $this->composerInstall($projectPath, $output); |
| 26 | 25 | $this->installMagento($config, $options, $projectPath, $output); |
| 27 | 26 | $this->finaliseSetup($options, $projectPath, $output); |
@@ -34,8 +33,7 @@ discard block |
||
| 34 | 33 | * @param $projectPath |
| 35 | 34 | * @param OutputInterface $output |
| 36 | 35 | */ |
| 37 | - protected function composerInstall($projectPath, OutputInterface $output) |
|
| 38 | - { |
|
| 36 | + protected function composerInstall($projectPath, OutputInterface $output) { |
|
| 39 | 37 | $output->writeln('<info>Installing Magento 2 with Composer</info>'); |
| 40 | 38 | $command = 'composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition public'; |
| 41 | 39 | new ProcessCommand($command, $projectPath, $output); |
@@ -50,8 +48,7 @@ discard block |
||
| 50 | 48 | * @param $destination |
| 51 | 49 | * @return bool |
| 52 | 50 | */ |
| 53 | - protected function copyAuthFile($destination) |
|
| 54 | - { |
|
| 51 | + protected function copyAuthFile($destination) { |
|
| 55 | 52 | $authFile = $_SERVER['HOME'] . "/.composer/auth.json"; |
| 56 | 53 | return copy($authFile, $destination . '/public/auth.json'); |
| 57 | 54 | } |
@@ -60,8 +57,7 @@ discard block |
||
| 60 | 57 | * @param $projectPath |
| 61 | 58 | * @param OutputInterface $output |
| 62 | 59 | */ |
| 63 | - protected function addPhpSpecPackage($projectPath, OutputInterface $output) |
|
| 64 | - { |
|
| 60 | + protected function addPhpSpecPackage($projectPath, OutputInterface $output) { |
|
| 65 | 61 | $output->writeln('<comment>Installing PHPSpec</comment>'); |
| 66 | 62 | $command = 'cd '.$projectPath.'/public; composer require phpspec/phpspec --dev;'; |
| 67 | 63 | new ProcessCommand($command, $projectPath, $output); |
@@ -73,8 +69,7 @@ discard block |
||
| 73 | 69 | * @param $projectPath |
| 74 | 70 | * @param OutputInterface $output |
| 75 | 71 | */ |
| 76 | - protected function addBehatPackage($projectPath, OutputInterface $output) |
|
| 77 | - { |
|
| 72 | + protected function addBehatPackage($projectPath, OutputInterface $output) { |
|
| 78 | 73 | $output->writeln('<comment>Installing Behat</comment>'); |
| 79 | 74 | $command = 'cd '.$projectPath.'/public; composer require behat/behat --dev;'; |
| 80 | 75 | new ProcessCommand($command, $projectPath, $output); |
@@ -88,8 +83,7 @@ discard block |
||
| 88 | 83 | * @param $projectPath |
| 89 | 84 | * @param OutputInterface $output |
| 90 | 85 | */ |
| 91 | - protected function installMagento(array $config, array $options, $projectPath, OutputInterface $output) |
|
| 92 | - { |
|
| 86 | + protected function installMagento(array $config, array $options, $projectPath, OutputInterface $output) { |
|
| 93 | 87 | $this->setPermissions($projectPath, $output); |
| 94 | 88 | |
| 95 | 89 | $this->installSampleData($options, $projectPath, $output); |
@@ -125,8 +119,7 @@ discard block |
||
| 125 | 119 | * @param $projectPath |
| 126 | 120 | * @param OutputInterface $output |
| 127 | 121 | */ |
| 128 | - protected function installSampleData($options, $projectPath, OutputInterface $output) |
|
| 129 | - { |
|
| 122 | + protected function installSampleData($options, $projectPath, OutputInterface $output) { |
|
| 130 | 123 | if (true === $options['installSampleData']) { |
| 131 | 124 | $output->writeln('<info>Installing Magento 2 Sample Data</info>'); |
| 132 | 125 | $deployCommand = 'vagrant ssh -c \'cd /var/www/public; bin/magento sampledata:deploy \''; |
@@ -138,8 +131,7 @@ discard block |
||
| 138 | 131 | * @param $projectPath |
| 139 | 132 | * @param OutputInterface $output |
| 140 | 133 | */ |
| 141 | - protected function setPermissions($projectPath, OutputInterface $output) |
|
| 142 | - { |
|
| 134 | + protected function setPermissions($projectPath, OutputInterface $output) { |
|
| 143 | 135 | $output->writeln('<info>Setting Permissions</info>'); |
| 144 | 136 | $command = 'vagrant ssh -c \'cd /var/www/public; sudo find . -type d -exec chmod 700 {} \;\''; |
| 145 | 137 | new ProcessCommand($command, $projectPath, $output); |
@@ -158,8 +150,7 @@ discard block |
||
| 158 | 150 | * @param $projectPath |
| 159 | 151 | * @param OutputInterface $output |
| 160 | 152 | */ |
| 161 | - protected function configureRedis($projectPath, OutputInterface $output) |
|
| 162 | - { |
|
| 153 | + protected function configureRedis($projectPath, OutputInterface $output) { |
|
| 163 | 154 | $output->writeln('<comment>Configuring Redis Cache</comment>'); |
| 164 | 155 | $file = "$projectPath/public/app/etc/env.php"; |
| 165 | 156 | $env = include $file; |
@@ -211,8 +202,7 @@ discard block |
||
| 211 | 202 | * @param $projectPath |
| 212 | 203 | * @param OutputInterface $output |
| 213 | 204 | */ |
| 214 | - protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) |
|
| 215 | - { |
|
| 205 | + protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) { |
|
| 216 | 206 | $command = 'vagrant ssh -c \'cd /var/www/public; bin/magento indexer:reindex; \''; |
| 217 | 207 | $output->writeln('<comment>Reindexing Tables</comment>'); |
| 218 | 208 | new ProcessCommand($command, $projectPath, $output); |
@@ -229,8 +219,7 @@ discard block |
||
| 229 | 219 | * @param array $options |
| 230 | 220 | * @param OutputInterface $output |
| 231 | 221 | */ |
| 232 | - protected function showCredentials(array $options, OutputInterface $output) |
|
| 233 | - { |
|
| 222 | + protected function showCredentials(array $options, OutputInterface $output) { |
|
| 234 | 223 | $output->writeln('<info>SUCCESS: Magestead has finished installing Magento 2!</info>'); |
| 235 | 224 | $table = new Table($output); |
| 236 | 225 | $table |
@@ -249,8 +238,7 @@ discard block |
||
| 249 | 238 | * @param OutputInterface $output |
| 250 | 239 | * @return VersionControl|null |
| 251 | 240 | */ |
| 252 | - protected function processVcs(array $options, $projectPath, OutputInterface $output) |
|
| 253 | - { |
|
| 241 | + protected function processVcs(array $options, $projectPath, OutputInterface $output) { |
|
| 254 | 242 | if (!empty($options['repo_url'])) { |
| 255 | 243 | copy($projectPath . "/puphpet/magestead/magento2/stubs/gitignore.tmp", $projectPath . "/.gitignore"); |
| 256 | 244 | return new VersionControl($options['repo_url'], $projectPath, $output); |
@@ -260,8 +248,7 @@ discard block |
||
| 260 | 248 | /** |
| 261 | 249 | * @param $projectPath |
| 262 | 250 | */ |
| 263 | - protected function setComposerBinDir($projectPath) |
|
| 264 | - { |
|
| 251 | + protected function setComposerBinDir($projectPath) { |
|
| 265 | 252 | $file = "$projectPath/public/composer.json"; |
| 266 | 253 | $composer = json_decode(file_get_contents($file), true); |
| 267 | 254 | |
@@ -273,8 +260,7 @@ discard block |
||
| 273 | 260 | * @param $projectPath |
| 274 | 261 | * @param OutputInterface $output |
| 275 | 262 | */ |
| 276 | - protected function setPhpSpecPermissions($projectPath, OutputInterface $output) |
|
| 277 | - { |
|
| 263 | + protected function setPhpSpecPermissions($projectPath, OutputInterface $output) { |
|
| 278 | 264 | $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/phpspec; bin/phpspec run\''; |
| 279 | 265 | new ProcessCommand($command, $projectPath, $output); |
| 280 | 266 | } |
@@ -283,8 +269,7 @@ discard block |
||
| 283 | 269 | * @param $projectPath |
| 284 | 270 | * @param OutputInterface $output |
| 285 | 271 | */ |
| 286 | - protected function setBehatPermissions($projectPath, OutputInterface $output) |
|
| 287 | - { |
|
| 272 | + protected function setBehatPermissions($projectPath, OutputInterface $output) { |
|
| 288 | 273 | $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/behat; bin/behat --init\''; |
| 289 | 274 | new ProcessCommand($command, $projectPath, $output); |
| 290 | 275 | } |
@@ -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 |
@@ -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 | |
@@ -37,8 +37,7 @@ discard block |
||
| 37 | 37 | * @param OutputInterface $output |
| 38 | 38 | * @param $project |
| 39 | 39 | */ |
| 40 | - public function __construct($helper, InputInterface $input, OutputInterface $output, $project) |
|
| 41 | - { |
|
| 40 | + public function __construct($helper, InputInterface $input, OutputInterface $output, $project) { |
|
| 42 | 41 | $this->setVagrantSettings($helper, $input, $output); |
| 43 | 42 | |
| 44 | 43 | $this->setServerConfig($helper, $input, $output); |
@@ -53,8 +52,7 @@ discard block |
||
| 53 | 52 | /** |
| 54 | 53 | * @return array |
| 55 | 54 | */ |
| 56 | - public function getAllOptions() |
|
| 57 | - { |
|
| 55 | + public function getAllOptions() { |
|
| 58 | 56 | return [ |
| 59 | 57 | 'app' => $this->_app, |
| 60 | 58 | 'server' => $this->_server, |
@@ -79,8 +77,7 @@ discard block |
||
| 79 | 77 | * @param InputInterface $input |
| 80 | 78 | * @param OutputInterface $output |
| 81 | 79 | */ |
| 82 | - protected function setVagrantSettings($helper, InputInterface $input, OutputInterface $output) |
|
| 83 | - { |
|
| 80 | + protected function setVagrantSettings($helper, InputInterface $input, OutputInterface $output) { |
|
| 84 | 81 | $output->writeln('<comment>Lets configure your project\'s VM</comment>'); |
| 85 | 82 | |
| 86 | 83 | $ipQuestion = new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
@@ -99,8 +96,7 @@ discard block |
||
| 99 | 96 | * @param OutputInterface $output |
| 100 | 97 | * @param $project |
| 101 | 98 | */ |
| 102 | - protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) |
|
| 103 | - { |
|
| 99 | + protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) { |
|
| 104 | 100 | $output->writeln('<comment>Lets configure your project\'s application</comment>'); |
| 105 | 101 | $appQuestion = new ChoiceQuestion( |
| 106 | 102 | "Which application do you want to install?", |
@@ -126,8 +122,7 @@ discard block |
||
| 126 | 122 | * @param OutputInterface $output |
| 127 | 123 | * @return boolean|integer |
| 128 | 124 | */ |
| 129 | - protected function setMagento2Settings($helper, InputInterface $input, OutputInterface $output) |
|
| 130 | - { |
|
| 125 | + protected function setMagento2Settings($helper, InputInterface $input, OutputInterface $output) { |
|
| 131 | 126 | if ($this->_app === 'magento2') { |
| 132 | 127 | $this->installSampleData($helper, $input, $output); |
| 133 | 128 | return $this->verifyAuth($helper, $input, $output); |
@@ -141,8 +136,7 @@ discard block |
||
| 141 | 136 | * @param InputInterface $input |
| 142 | 137 | * @param OutputInterface $output |
| 143 | 138 | */ |
| 144 | - protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
|
| 145 | - { |
|
| 139 | + protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) { |
|
| 146 | 140 | $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
| 147 | 141 | $versioning = $helper->ask($input, $output, $versionControl); |
| 148 | 142 | if ($versioning) { |
@@ -151,8 +145,7 @@ discard block |
||
| 151 | 145 | } |
| 152 | 146 | } |
| 153 | 147 | |
| 154 | - protected function installSampleData($helper, InputInterface $input, OutputInterface $output) |
|
| 155 | - { |
|
| 148 | + protected function installSampleData($helper, InputInterface $input, OutputInterface $output) { |
|
| 156 | 149 | $sampleInstall = new ConfirmationQuestion("Would you like to install sample data? (no/yes) ", false); |
| 157 | 150 | $this->installSampleData = $helper->ask($input, $output, $sampleInstall); |
| 158 | 151 | } |
@@ -162,8 +155,7 @@ discard block |
||
| 162 | 155 | * @param InputInterface $input |
| 163 | 156 | * @param OutputInterface $output |
| 164 | 157 | */ |
| 165 | - protected function askForAuth($helper, InputInterface $input, OutputInterface $output) |
|
| 166 | - { |
|
| 158 | + protected function askForAuth($helper, InputInterface $input, OutputInterface $output) { |
|
| 167 | 159 | $username = new Question("Please enter your Magento username (public key): ", ''); |
| 168 | 160 | $this->_m2Username = $helper->ask($input, $output, $username); |
| 169 | 161 | |
@@ -177,8 +169,7 @@ discard block |
||
| 177 | 169 | * @param OutputInterface $output |
| 178 | 170 | * @return boolean|integer |
| 179 | 171 | */ |
| 180 | - protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) |
|
| 181 | - { |
|
| 172 | + protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) { |
|
| 182 | 173 | $authFile = $_SERVER['HOME'] . "/.composer/auth.json"; |
| 183 | 174 | |
| 184 | 175 | $authObj = []; |
@@ -205,8 +196,7 @@ discard block |
||
| 205 | 196 | * @param InputInterface $input |
| 206 | 197 | * @param OutputInterface $output |
| 207 | 198 | */ |
| 208 | - protected function setPhp($helper, InputInterface $input, OutputInterface $output) |
|
| 209 | - { |
|
| 199 | + protected function setPhp($helper, InputInterface $input, OutputInterface $output) { |
|
| 210 | 200 | $phpVerQuestion = new ChoiceQuestion( |
| 211 | 201 | "Which version of PHP should be installed?", |
| 212 | 202 | ['56', '70'], |
@@ -219,8 +209,7 @@ discard block |
||
| 219 | 209 | /** |
| 220 | 210 | * Set box name from concat user options |
| 221 | 211 | */ |
| 222 | - protected function setVagrantBox() |
|
| 223 | - { |
|
| 212 | + protected function setVagrantBox() { |
|
| 224 | 213 | $this->_box = self::BOX_PREFIX . $this->_os . "-$this->_server-php$this->_phpVer"; |
| 225 | 214 | } |
| 226 | 215 | |
@@ -229,8 +218,7 @@ discard block |
||
| 229 | 218 | * @param InputInterface $input |
| 230 | 219 | * @param OutputInterface $output |
| 231 | 220 | */ |
| 232 | - protected function setServerConfig($helper, InputInterface $input, OutputInterface $output) |
|
| 233 | - { |
|
| 221 | + protected function setServerConfig($helper, InputInterface $input, OutputInterface $output) { |
|
| 234 | 222 | $output->writeln('<comment>Lets configure your server</comment>'); |
| 235 | 223 | $this->setOperatingSystem($helper, $input, $output); |
| 236 | 224 | $this->setWebServer($helper, $input, $output); |
@@ -242,8 +230,7 @@ discard block |
||
| 242 | 230 | * @param InputInterface $input |
| 243 | 231 | * @param OutputInterface $output |
| 244 | 232 | */ |
| 245 | - protected function setWebServer($helper, InputInterface $input, OutputInterface $output) |
|
| 246 | - { |
|
| 233 | + protected function setWebServer($helper, InputInterface $input, OutputInterface $output) { |
|
| 247 | 234 | $serverQuestion = new ChoiceQuestion( |
| 248 | 235 | "Which webserver would you like?", |
| 249 | 236 | ['NGINX', 'Apache'], |
@@ -258,8 +245,7 @@ discard block |
||
| 258 | 245 | * @param InputInterface $input |
| 259 | 246 | * @param OutputInterface $output |
| 260 | 247 | */ |
| 261 | - protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) |
|
| 262 | - { |
|
| 248 | + protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) { |
|
| 263 | 249 | $osQuestion = new ChoiceQuestion( |
| 264 | 250 | "Which OS would you like to install?", |
| 265 | 251 | ['CentOS 6.5', 'Ubuntu 14'], |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | protected $_currency; |
| 29 | 29 | protected $_baseUrl; |
| 30 | 30 | protected $_repoUrl = ''; |
| 31 | - protected $installSampleData = false; |
|
| 31 | + protected $installSampleData = FALSE; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Options constructor. |
@@ -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: ", ''); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | protected function installSampleData($helper, InputInterface $input, OutputInterface $output) |
| 155 | 155 | { |
| 156 | - $sampleInstall = new ConfirmationQuestion("Would you like to install sample data? (no/yes) ", false); |
|
| 156 | + $sampleInstall = new ConfirmationQuestion("Would you like to install sample data? (no/yes) ", FALSE); |
|
| 157 | 157 | $this->installSampleData = $helper->ask($input, $output, $sampleInstall); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -184,10 +184,10 @@ discard block |
||
| 184 | 184 | $authObj = []; |
| 185 | 185 | if (file_exists($authFile)) { |
| 186 | 186 | $authJson = file_get_contents($authFile); |
| 187 | - $authObj = (array)json_decode($authJson, true); |
|
| 187 | + $authObj = (array)json_decode($authJson, TRUE); |
|
| 188 | 188 | |
| 189 | 189 | if (isset($authObj['http-basic']) && isset($authObj['http-basic']->{'repo.magento.com'})) { |
| 190 | - return true; |
|
| 190 | + return TRUE; |
|
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | |
@@ -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); |
|
| 201 | + $authJson=json_encode($authObj); |
|
| 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 | } |
@@ -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 |