@@ -12,11 +12,11 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | class Options |
| 14 | 14 | { |
| 15 | - const BOX_PREFIX = 'richdynamix/magestead-'; |
|
| 15 | + const BOX_PREFIX='richdynamix/magestead-'; |
|
| 16 | 16 | |
| 17 | - protected $_app = 'magento2'; |
|
| 18 | - protected $_phpVer = '56'; |
|
| 19 | - protected $_os = 'centos65'; |
|
| 17 | + protected $_app='magento2'; |
|
| 18 | + protected $_phpVer='56'; |
|
| 19 | + protected $_os='centos65'; |
|
| 20 | 20 | protected $_server; |
| 21 | 21 | protected $_box; |
| 22 | 22 | protected $_m2Username; |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | protected $_locale; |
| 28 | 28 | protected $_currency; |
| 29 | 29 | protected $_baseUrl; |
| 30 | - protected $_repoUrl = ''; |
|
| 31 | - protected $installSampleData = false; |
|
| 30 | + protected $_repoUrl=''; |
|
| 31 | + protected $installSampleData=false; |
|
| 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,18 +143,18 @@ 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 | |
| 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); |
|
| 157 | - $this->installSampleData = $helper->ask($input, $output, $sampleInstall); |
|
| 156 | + $sampleInstall=new ConfirmationQuestion("Would you like to install sample data? (no/yes) ", false); |
|
| 157 | + $this->installSampleData=$helper->ask($input, $output, $sampleInstall); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /** |
@@ -164,11 +164,11 @@ discard block |
||
| 164 | 164 | */ |
| 165 | 165 | protected function askForAuth($helper, InputInterface $input, OutputInterface $output) |
| 166 | 166 | { |
| 167 | - $username = new Question("Please enter your Magento username (public key): ", ''); |
|
| 168 | - $this->_m2Username = $helper->ask($input, $output, $username); |
|
| 167 | + $username=new Question("Please enter your Magento username (public key): ", ''); |
|
| 168 | + $this->_m2Username=$helper->ask($input, $output, $username); |
|
| 169 | 169 | |
| 170 | - $password = new Question("Please enter your Magento password (private key): ", ''); |
|
| 171 | - $this->_m2Password = $helper->ask($input, $output, $password); |
|
| 170 | + $password=new Question("Please enter your Magento password (private key): ", ''); |
|
| 171 | + $this->_m2Password=$helper->ask($input, $output, $password); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | /** |
@@ -179,12 +179,12 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) |
| 181 | 181 | { |
| 182 | - $authFile = $_SERVER['HOME'] . "/.composer/auth.json"; |
|
| 182 | + $authFile=$_SERVER['HOME']."/.composer/auth.json"; |
|
| 183 | 183 | |
| 184 | - $authObj = []; |
|
| 184 | + $authObj=[]; |
|
| 185 | 185 | if (file_exists($authFile)) { |
| 186 | - $authJson = file_get_contents($authFile); |
|
| 187 | - $authObj = (array)json_decode($authJson, true); |
|
| 186 | + $authJson=file_get_contents($authFile); |
|
| 187 | + $authObj=(array) json_decode($authJson, true); |
|
| 188 | 188 | |
| 189 | 189 | if (isset($authObj['http-basic']) && isset($authObj['http-basic']->{'repo.magento.com'})) { |
| 190 | 190 | return true; |
@@ -193,10 +193,10 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | $this->askForAuth($helper, $input, $output); |
| 195 | 195 | |
| 196 | - $authObj['http-basic']['repo.magento.com']['username'] = $this->_m2Username; |
|
| 197 | - $authObj['http-basic']['repo.magento.com']['password'] = $this->_m2Password; |
|
| 196 | + $authObj['http-basic']['repo.magento.com']['username']=$this->_m2Username; |
|
| 197 | + $authObj['http-basic']['repo.magento.com']['password']=$this->_m2Password; |
|
| 198 | 198 | |
| 199 | - $authJson = json_encode($authObj); |
|
| 199 | + $authJson=json_encode($authObj); |
|
| 200 | 200 | return file_put_contents($authFile, $authJson); |
| 201 | 201 | } |
| 202 | 202 | |
@@ -207,13 +207,13 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | protected function setPhp($helper, InputInterface $input, OutputInterface $output) |
| 209 | 209 | { |
| 210 | - $phpVerQuestion = new ChoiceQuestion( |
|
| 210 | + $phpVerQuestion=new ChoiceQuestion( |
|
| 211 | 211 | "Which version of PHP should be installed?", |
| 212 | 212 | ['56', '70'], |
| 213 | 213 | 0 |
| 214 | 214 | ); |
| 215 | 215 | |
| 216 | - $this->_phpVer = $helper->ask($input, $output, $phpVerQuestion); |
|
| 216 | + $this->_phpVer=$helper->ask($input, $output, $phpVerQuestion); |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | */ |
| 222 | 222 | protected function setVagrantBox() |
| 223 | 223 | { |
| 224 | - $this->_box = self::BOX_PREFIX . $this->_os . "-$this->_server-php$this->_phpVer"; |
|
| 224 | + $this->_box=self::BOX_PREFIX.$this->_os."-$this->_server-php$this->_phpVer"; |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | /** |
@@ -244,13 +244,13 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | protected function setWebServer($helper, InputInterface $input, OutputInterface $output) |
| 246 | 246 | { |
| 247 | - $serverQuestion = new ChoiceQuestion( |
|
| 247 | + $serverQuestion=new ChoiceQuestion( |
|
| 248 | 248 | "Which webserver would you like?", |
| 249 | 249 | ['NGINX', 'Apache'], |
| 250 | 250 | 0 |
| 251 | 251 | ); |
| 252 | 252 | |
| 253 | - $this->_server = strtolower($helper->ask($input, $output, $serverQuestion)); |
|
| 253 | + $this->_server=strtolower($helper->ask($input, $output, $serverQuestion)); |
|
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | /** |
@@ -260,12 +260,12 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) |
| 262 | 262 | { |
| 263 | - $osQuestion = new ChoiceQuestion( |
|
| 263 | + $osQuestion=new ChoiceQuestion( |
|
| 264 | 264 | "Which OS would you like to install?", |
| 265 | 265 | ['CentOS 6.5', 'Ubuntu 14'], |
| 266 | 266 | 0 |
| 267 | 267 | ); |
| 268 | 268 | |
| 269 | - $this->_os = str_replace(' ', '', str_replace('.', '', strtolower($helper->ask($input, $output, $osQuestion)))); |
|
| 269 | + $this->_os=str_replace(' ', '', str_replace('.', '', strtolower($helper->ask($input, $output, $osQuestion)))); |
|
| 270 | 270 | } |
| 271 | 271 | } |