@@ -53,20 +53,20 @@ |
||
| 53 | 53 | public function getAllOptions() |
| 54 | 54 | { |
| 55 | 55 | return [ |
| 56 | - 'app' => $this->_app, |
|
| 57 | - 'server' => $this->_server, |
|
| 58 | - 'phpver' => $this->_phpVer, |
|
| 59 | - 'os' => $this->_os, |
|
| 60 | - 'box' => $this->_box, |
|
| 61 | - 'm2user' => $this->_m2Username, |
|
| 62 | - 'm2pass' => $this->_m2Password, |
|
| 63 | - 'repo_url' => $this->_repoUrl, |
|
| 64 | - 'ip_address' => $this->_ipAddress, |
|
| 65 | - 'cpus' => $this->_cpus, |
|
| 66 | - 'memory_limit' => $this->_memorylimit, |
|
| 67 | - 'locale' => $this->_locale, |
|
| 68 | - 'default_currency' => $this->_currency, |
|
| 69 | - 'base_url' => $this->_baseUrl, |
|
| 56 | + 'app' => $this->_app, |
|
| 57 | + 'server' => $this->_server, |
|
| 58 | + 'phpver' => $this->_phpVer, |
|
| 59 | + 'os' => $this->_os, |
|
| 60 | + 'box' => $this->_box, |
|
| 61 | + 'm2user' => $this->_m2Username, |
|
| 62 | + 'm2pass' => $this->_m2Password, |
|
| 63 | + 'repo_url' => $this->_repoUrl, |
|
| 64 | + 'ip_address' => $this->_ipAddress, |
|
| 65 | + 'cpus' => $this->_cpus, |
|
| 66 | + 'memory_limit' => $this->_memorylimit, |
|
| 67 | + 'locale' => $this->_locale, |
|
| 68 | + 'default_currency' => $this->_currency, |
|
| 69 | + 'base_url' => $this->_baseUrl, |
|
| 70 | 70 | ]; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -34,8 +34,7 @@ discard block |
||
| 34 | 34 | * @param InputInterface $input |
| 35 | 35 | * @param OutputInterface $output |
| 36 | 36 | */ |
| 37 | - public function __construct($helper, InputInterface $input, OutputInterface $output) |
|
| 38 | - { |
|
| 37 | + public function __construct($helper, InputInterface $input, OutputInterface $output) { |
|
| 39 | 38 | $this->setVagrantSettings($helper, $input, $output); |
| 40 | 39 | |
| 41 | 40 | $this->setServerConfig($helper, $input, $output); |
@@ -50,8 +49,7 @@ discard block |
||
| 50 | 49 | /** |
| 51 | 50 | * @return array |
| 52 | 51 | */ |
| 53 | - public function getAllOptions() |
|
| 54 | - { |
|
| 52 | + public function getAllOptions() { |
|
| 55 | 53 | return [ |
| 56 | 54 | 'app' => $this->_app, |
| 57 | 55 | 'server' => $this->_server, |
@@ -75,8 +73,7 @@ discard block |
||
| 75 | 73 | * @param InputInterface $input |
| 76 | 74 | * @param OutputInterface $output |
| 77 | 75 | */ |
| 78 | - protected function setVagrantSettings($helper, InputInterface $input, OutputInterface $output) |
|
| 79 | - { |
|
| 76 | + protected function setVagrantSettings($helper, InputInterface $input, OutputInterface $output) { |
|
| 80 | 77 | $output->writeln('<comment>Lets configure your project\'s VM</comment>'); |
| 81 | 78 | |
| 82 | 79 | $ipQuestion = new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
@@ -94,8 +91,7 @@ discard block |
||
| 94 | 91 | * @param InputInterface $input |
| 95 | 92 | * @param OutputInterface $output |
| 96 | 93 | */ |
| 97 | - protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output) |
|
| 98 | - { |
|
| 94 | + protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output) { |
|
| 99 | 95 | $output->writeln('<comment>Lets configure your project\'s application</comment>'); |
| 100 | 96 | if ($this->_phpVer !== '70') { |
| 101 | 97 | $appQuestion = new ChoiceQuestion( |
@@ -122,8 +118,7 @@ discard block |
||
| 122 | 118 | * @param OutputInterface $output |
| 123 | 119 | * @return bool |
| 124 | 120 | */ |
| 125 | - protected function setMagento2Settings($helper, InputInterface $input, OutputInterface $output) |
|
| 126 | - { |
|
| 121 | + protected function setMagento2Settings($helper, InputInterface $input, OutputInterface $output) { |
|
| 127 | 122 | if ($this->_app === 'magento2') { |
| 128 | 123 | return $this->verifyAuth($helper, $input, $output); |
| 129 | 124 | } |
@@ -136,8 +131,7 @@ discard block |
||
| 136 | 131 | * @param InputInterface $input |
| 137 | 132 | * @param OutputInterface $output |
| 138 | 133 | */ |
| 139 | - protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
|
| 140 | - { |
|
| 134 | + protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) { |
|
| 141 | 135 | $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
| 142 | 136 | $versioning = $helper->ask($input, $output, $versionControl); |
| 143 | 137 | if ($versioning) { |
@@ -151,8 +145,7 @@ discard block |
||
| 151 | 145 | * @param InputInterface $input |
| 152 | 146 | * @param OutputInterface $output |
| 153 | 147 | */ |
| 154 | - protected function askForAuth($helper, InputInterface $input, OutputInterface $output) |
|
| 155 | - { |
|
| 148 | + protected function askForAuth($helper, InputInterface $input, OutputInterface $output) { |
|
| 156 | 149 | $username = new Question("Please enter your Magento username (public key): ", ''); |
| 157 | 150 | $this->_m2Username = $helper->ask($input, $output, $username); |
| 158 | 151 | |
@@ -166,8 +159,7 @@ discard block |
||
| 166 | 159 | * @param OutputInterface $output |
| 167 | 160 | * @return bool |
| 168 | 161 | */ |
| 169 | - protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) |
|
| 170 | - { |
|
| 162 | + protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) { |
|
| 171 | 163 | $authFile = $_SERVER['HOME'] . "/.composer/auth.json"; |
| 172 | 164 | |
| 173 | 165 | $authObj = []; |
@@ -194,8 +186,7 @@ discard block |
||
| 194 | 186 | * @param InputInterface $input |
| 195 | 187 | * @param OutputInterface $output |
| 196 | 188 | */ |
| 197 | - protected function setPhp($helper, InputInterface $input, OutputInterface $output) |
|
| 198 | - { |
|
| 189 | + protected function setPhp($helper, InputInterface $input, OutputInterface $output) { |
|
| 199 | 190 | $output->writeln('<info>Keep in mind PHP7 is only available for Magento 2</info>'); |
| 200 | 191 | $phpVerQuestion = new ChoiceQuestion( |
| 201 | 192 | "Which version of PHP should be installed?", |
@@ -209,8 +200,7 @@ discard block |
||
| 209 | 200 | /** |
| 210 | 201 | * Set box name from concat user options |
| 211 | 202 | */ |
| 212 | - protected function setVagrantBox() |
|
| 213 | - { |
|
| 203 | + protected function setVagrantBox() { |
|
| 214 | 204 | $this->_box = self::BOX_PREFIX . $this->_os . "-$this->_server-php$this->_phpVer"; |
| 215 | 205 | } |
| 216 | 206 | |
@@ -219,8 +209,7 @@ discard block |
||
| 219 | 209 | * @param InputInterface $input |
| 220 | 210 | * @param OutputInterface $output |
| 221 | 211 | */ |
| 222 | - protected function setServerConfig($helper, InputInterface $input, OutputInterface $output) |
|
| 223 | - { |
|
| 212 | + protected function setServerConfig($helper, InputInterface $input, OutputInterface $output) { |
|
| 224 | 213 | $output->writeln('<comment>Lets configure your server</comment>'); |
| 225 | 214 | $this->setOperatingSystem($helper, $input, $output); |
| 226 | 215 | $this->setWebServer($helper, $input, $output); |
@@ -232,8 +221,7 @@ discard block |
||
| 232 | 221 | * @param InputInterface $input |
| 233 | 222 | * @param OutputInterface $output |
| 234 | 223 | */ |
| 235 | - protected function setWebServer($helper, InputInterface $input, OutputInterface $output) |
|
| 236 | - { |
|
| 224 | + protected function setWebServer($helper, InputInterface $input, OutputInterface $output) { |
|
| 237 | 225 | $serverQuestion = new ChoiceQuestion( |
| 238 | 226 | "Which webserver would you like?", |
| 239 | 227 | ['NGINX', 'Apache'], |
@@ -247,8 +235,7 @@ discard block |
||
| 247 | 235 | * @param InputInterface $input |
| 248 | 236 | * @param OutputInterface $output |
| 249 | 237 | */ |
| 250 | - protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) |
|
| 251 | - { |
|
| 238 | + protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) { |
|
| 252 | 239 | $osQuestion = new ChoiceQuestion( |
| 253 | 240 | "Which OS would you like to install?", |
| 254 | 241 | ['CentOS 6.5', 'Ubuntu 14'], |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | return $this->verifyAuth($helper, $input, $output); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - return true; |
|
| 131 | + return TRUE; |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | /** |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
| 140 | 140 | { |
| 141 | - $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
|
| 141 | + $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", FALSE); |
|
| 142 | 142 | $versioning = $helper->ask($input, $output, $versionControl); |
| 143 | 143 | if ($versioning) { |
| 144 | 144 | $repoQuestion = new Question("Enter your full GitHub/BitBucket repo URL: ", ''); |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $authObj = (array)json_decode($authJson); |
| 177 | 177 | |
| 178 | 178 | if (isset($authObj['http-basic']) && isset($authObj['http-basic']->{'repo.magento.com'})) { |
| 179 | - return true; |
|
| 179 | + return TRUE; |
|
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
@@ -12,11 +12,11 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | class Options |
| 14 | 14 | { |
| 15 | - const BOX_PREFIX = 'richdynamix/magestead-'; |
|
| 16 | - protected $_app = 'magento2'; |
|
| 15 | + const BOX_PREFIX='richdynamix/magestead-'; |
|
| 16 | + protected $_app='magento2'; |
|
| 17 | 17 | protected $_server; |
| 18 | - protected $_phpVer = '56'; |
|
| 19 | - protected $_os = 'centos65'; |
|
| 18 | + protected $_phpVer='56'; |
|
| 19 | + protected $_os='centos65'; |
|
| 20 | 20 | protected $_box; |
| 21 | 21 | protected $_m2Username; |
| 22 | 22 | protected $_m2Password; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | protected $_locale; |
| 27 | 27 | protected $_currency; |
| 28 | 28 | protected $_baseUrl; |
| 29 | - protected $_repoUrl = ''; |
|
| 29 | + protected $_repoUrl=''; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Options constructor. |
@@ -79,14 +79,14 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | $output->writeln('<comment>Lets configure your project\'s VM</comment>'); |
| 81 | 81 | |
| 82 | - $ipQuestion = new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
|
| 83 | - $this->_ipAddress = strtolower($helper->ask($input, $output, $ipQuestion)); |
|
| 82 | + $ipQuestion=new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
|
| 83 | + $this->_ipAddress=strtolower($helper->ask($input, $output, $ipQuestion)); |
|
| 84 | 84 | |
| 85 | - $cpuQuestion = new Question("How many CPU's would you like to use? (1): ", '1'); |
|
| 86 | - $this->_cpus = strtolower($helper->ask($input, $output, $cpuQuestion)); |
|
| 85 | + $cpuQuestion=new Question("How many CPU's would you like to use? (1): ", '1'); |
|
| 86 | + $this->_cpus=strtolower($helper->ask($input, $output, $cpuQuestion)); |
|
| 87 | 87 | |
| 88 | - $memoryQuestion = new Question("Define the VM memory limit (2048): ", '2048'); |
|
| 89 | - $this->_memorylimit = strtolower($helper->ask($input, $output, $memoryQuestion)); |
|
| 88 | + $memoryQuestion=new Question("Define the VM memory limit (2048): ", '2048'); |
|
| 89 | + $this->_memorylimit=strtolower($helper->ask($input, $output, $memoryQuestion)); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -98,22 +98,22 @@ discard block |
||
| 98 | 98 | { |
| 99 | 99 | $output->writeln('<comment>Lets configure your project\'s application</comment>'); |
| 100 | 100 | if ($this->_phpVer !== '70') { |
| 101 | - $appQuestion = new ChoiceQuestion( |
|
| 101 | + $appQuestion=new ChoiceQuestion( |
|
| 102 | 102 | "Which application do you want to install?", |
| 103 | 103 | ['Magento', 'Magento 2'], |
| 104 | 104 | 0 |
| 105 | 105 | ); |
| 106 | 106 | |
| 107 | - $this->_app = strtolower($helper->ask($input, $output, $appQuestion)); |
|
| 107 | + $this->_app=strtolower($helper->ask($input, $output, $appQuestion)); |
|
| 108 | 108 | } |
| 109 | - $baseUrlQuestion = new Question("Enter your application's base_url (magestead.dev): ", 'magestead.dev'); |
|
| 110 | - $this->_baseUrl = strtolower($helper->ask($input, $output, $baseUrlQuestion)); |
|
| 109 | + $baseUrlQuestion=new Question("Enter your application's base_url (magestead.dev): ", 'magestead.dev'); |
|
| 110 | + $this->_baseUrl=strtolower($helper->ask($input, $output, $baseUrlQuestion)); |
|
| 111 | 111 | |
| 112 | - $currenyQuestion = new Question("Enter your application's default currency (GBP): ", 'GBP'); |
|
| 113 | - $this->_currency = $helper->ask($input, $output, $currenyQuestion); |
|
| 112 | + $currenyQuestion=new Question("Enter your application's default currency (GBP): ", 'GBP'); |
|
| 113 | + $this->_currency=$helper->ask($input, $output, $currenyQuestion); |
|
| 114 | 114 | |
| 115 | - $localeQuestion = new Question("Enter your application's default locale (en_GB): ", 'en_GB'); |
|
| 116 | - $this->_locale = $helper->ask($input, $output, $localeQuestion); |
|
| 115 | + $localeQuestion=new Question("Enter your application's default locale (en_GB): ", 'en_GB'); |
|
| 116 | + $this->_locale=$helper->ask($input, $output, $localeQuestion); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -138,11 +138,11 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
| 140 | 140 | { |
| 141 | - $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
|
| 142 | - $versioning = $helper->ask($input, $output, $versionControl); |
|
| 141 | + $versionControl=new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
|
| 142 | + $versioning=$helper->ask($input, $output, $versionControl); |
|
| 143 | 143 | if ($versioning) { |
| 144 | - $repoQuestion = new Question("Enter your full GitHub/BitBucket repo URL: ", ''); |
|
| 145 | - $this->_repoUrl = strtolower($helper->ask($input, $output, $repoQuestion)); |
|
| 144 | + $repoQuestion=new Question("Enter your full GitHub/BitBucket repo URL: ", ''); |
|
| 145 | + $this->_repoUrl=strtolower($helper->ask($input, $output, $repoQuestion)); |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
@@ -153,11 +153,11 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | protected function askForAuth($helper, InputInterface $input, OutputInterface $output) |
| 155 | 155 | { |
| 156 | - $username = new Question("Please enter your Magento username (public key): ", ''); |
|
| 157 | - $this->_m2Username = $helper->ask($input, $output, $username); |
|
| 156 | + $username=new Question("Please enter your Magento username (public key): ", ''); |
|
| 157 | + $this->_m2Username=$helper->ask($input, $output, $username); |
|
| 158 | 158 | |
| 159 | - $password = new Question("Please enter your Magento password (private key): ", ''); |
|
| 160 | - $this->_m2Password = $helper->ask($input, $output, $password); |
|
| 159 | + $password=new Question("Please enter your Magento password (private key): ", ''); |
|
| 160 | + $this->_m2Password=$helper->ask($input, $output, $password); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -168,12 +168,12 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) |
| 170 | 170 | { |
| 171 | - $authFile = $_SERVER['HOME'] . "/.composer/auth.json"; |
|
| 171 | + $authFile=$_SERVER['HOME']."/.composer/auth.json"; |
|
| 172 | 172 | |
| 173 | - $authObj = []; |
|
| 173 | + $authObj=[]; |
|
| 174 | 174 | if (file_exists($authFile)) { |
| 175 | - $authJson = file_get_contents($authFile); |
|
| 176 | - $authObj = (array)json_decode($authJson); |
|
| 175 | + $authJson=file_get_contents($authFile); |
|
| 176 | + $authObj=(array) json_decode($authJson); |
|
| 177 | 177 | |
| 178 | 178 | if (isset($authObj['http-basic']) && isset($authObj['http-basic']->{'repo.magento.com'})) { |
| 179 | 179 | return true; |
@@ -182,10 +182,10 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $this->askForAuth($helper, $input, $output); |
| 184 | 184 | |
| 185 | - $authObj['http-basic']['repo.magento.com']['username'] = $this->_m2Username; |
|
| 186 | - $authObj['http-basic']['repo.magento.com']['password'] = $this->_m2Password; |
|
| 185 | + $authObj['http-basic']['repo.magento.com']['username']=$this->_m2Username; |
|
| 186 | + $authObj['http-basic']['repo.magento.com']['password']=$this->_m2Password; |
|
| 187 | 187 | |
| 188 | - $authJson = json_encode($authObj); |
|
| 188 | + $authJson=json_encode($authObj); |
|
| 189 | 189 | return file_put_contents($authFile, $authJson); |
| 190 | 190 | } |
| 191 | 191 | |
@@ -197,13 +197,13 @@ discard block |
||
| 197 | 197 | protected function setPhp($helper, InputInterface $input, OutputInterface $output) |
| 198 | 198 | { |
| 199 | 199 | $output->writeln('<info>Keep in mind PHP7 is only available for Magento 2</info>'); |
| 200 | - $phpVerQuestion = new ChoiceQuestion( |
|
| 200 | + $phpVerQuestion=new ChoiceQuestion( |
|
| 201 | 201 | "Which version of PHP should be installed?", |
| 202 | 202 | ['56', '70'], |
| 203 | 203 | 0 |
| 204 | 204 | ); |
| 205 | 205 | |
| 206 | - $this->_phpVer = $helper->ask($input, $output, $phpVerQuestion); |
|
| 206 | + $this->_phpVer=$helper->ask($input, $output, $phpVerQuestion); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | /** |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | protected function setVagrantBox() |
| 213 | 213 | { |
| 214 | - $this->_box = self::BOX_PREFIX . $this->_os . "-$this->_server-php$this->_phpVer"; |
|
| 214 | + $this->_box=self::BOX_PREFIX.$this->_os."-$this->_server-php$this->_phpVer"; |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | /** |
@@ -234,12 +234,12 @@ discard block |
||
| 234 | 234 | */ |
| 235 | 235 | protected function setWebServer($helper, InputInterface $input, OutputInterface $output) |
| 236 | 236 | { |
| 237 | - $serverQuestion = new ChoiceQuestion( |
|
| 237 | + $serverQuestion=new ChoiceQuestion( |
|
| 238 | 238 | "Which webserver would you like?", |
| 239 | 239 | ['NGINX', 'Apache'], |
| 240 | 240 | 0 |
| 241 | 241 | ); |
| 242 | - $this->_server = strtolower($helper->ask($input, $output, $serverQuestion)); |
|
| 242 | + $this->_server=strtolower($helper->ask($input, $output, $serverQuestion)); |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | /** |
@@ -249,11 +249,11 @@ discard block |
||
| 249 | 249 | */ |
| 250 | 250 | protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) |
| 251 | 251 | { |
| 252 | - $osQuestion = new ChoiceQuestion( |
|
| 252 | + $osQuestion=new ChoiceQuestion( |
|
| 253 | 253 | "Which OS would you like to install?", |
| 254 | 254 | ['CentOS 6.5', 'Ubuntu 14'], |
| 255 | 255 | 0 |
| 256 | 256 | ); |
| 257 | - $this->_os = str_replace(' ', '', str_replace('.', '', strtolower($helper->ask($input, $output, $osQuestion)))); |
|
| 257 | + $this->_os=str_replace(' ', '', str_replace('.', '', strtolower($helper->ask($input, $output, $osQuestion)))); |
|
| 258 | 258 | } |
| 259 | 259 | } |
| 260 | 260 | \ No newline at end of file |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | protected $_projectPath; |
| 21 | 21 | protected $_magesteadConfig; |
| 22 | 22 | |
| 23 | - protected function configure() |
|
| 24 | - { |
|
| 23 | + protected function configure() { |
|
| 25 | 24 | $this->_basePath = dirname( __FILE__ ) . '/../../../'; |
| 26 | 25 | $this->_projectPath = getcwd(); |
| 27 | 26 | |
@@ -34,8 +33,7 @@ discard block |
||
| 34 | 33 | * @param OutputInterface $output |
| 35 | 34 | * @return \Magestead\Installers\Magento2Project|\Magestead\Installers\MagentoProject |
| 36 | 35 | */ |
| 37 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 38 | - { |
|
| 36 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 39 | 37 | $helper = $this->getHelper('question'); |
| 40 | 38 | $options = new Options($helper, $input, $output); |
| 41 | 39 | |
@@ -52,8 +50,7 @@ discard block |
||
| 52 | 50 | * @param $target |
| 53 | 51 | * @param OutputInterface $output |
| 54 | 52 | */ |
| 55 | - protected function copyConfigFiles($source, $target, OutputInterface $output) |
|
| 56 | - { |
|
| 53 | + protected function copyConfigFiles($source, $target, OutputInterface $output) { |
|
| 57 | 54 | try { |
| 58 | 55 | $progress = new ProgressBar($output, 3720); |
| 59 | 56 | $progress->start(); |
@@ -80,8 +77,7 @@ discard block |
||
| 80 | 77 | * @param array $options |
| 81 | 78 | * @param OutputInterface $output |
| 82 | 79 | */ |
| 83 | - protected function configureProject(array $options, OutputInterface $output) |
|
| 84 | - { |
|
| 80 | + protected function configureProject(array $options, OutputInterface $output) { |
|
| 85 | 81 | $this->_magesteadConfig = $this->getConfigFile($output); |
| 86 | 82 | |
| 87 | 83 | $this->_magesteadConfig['vagrantfile']['vm']['box'] = $options['box']; |
@@ -103,8 +99,7 @@ discard block |
||
| 103 | 99 | * @param OutputInterface $output |
| 104 | 100 | * @return mixed |
| 105 | 101 | */ |
| 106 | - protected function getConfigFile(OutputInterface $output) |
|
| 107 | - { |
|
| 102 | + protected function getConfigFile(OutputInterface $output) { |
|
| 108 | 103 | $yaml = new Parser(); |
| 109 | 104 | try { |
| 110 | 105 | return $yaml->parse(file_get_contents($this->_projectPath . '/magestead.yaml')); |
@@ -118,8 +113,7 @@ discard block |
||
| 118 | 113 | * @param array $config |
| 119 | 114 | * @param OutputInterface $output |
| 120 | 115 | */ |
| 121 | - protected function saveConfigFile(array $config, OutputInterface $output) |
|
| 122 | - { |
|
| 116 | + protected function saveConfigFile(array $config, OutputInterface $output) { |
|
| 123 | 117 | $dumper = new Dumper(); |
| 124 | 118 | $yaml = $dumper->dump($config, 6); |
| 125 | 119 | |
@@ -134,8 +128,7 @@ discard block |
||
| 134 | 128 | * @param OutputInterface $output |
| 135 | 129 | * @param $options |
| 136 | 130 | */ |
| 137 | - protected function setupProject(OutputInterface $output, $options) |
|
| 138 | - { |
|
| 131 | + protected function setupProject(OutputInterface $output, $options) { |
|
| 139 | 132 | $output->writeln('<info>Setting up project structure</info>'); |
| 140 | 133 | $provisionFolder = $this->_basePath . "provision"; |
| 141 | 134 | $this->copyConfigFiles($provisionFolder, $this->_projectPath, $output); |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | protected function configure() |
| 24 | 24 | { |
| 25 | - $this->_basePath = dirname( __FILE__ ) . '/../../../'; |
|
| 26 | - $this->_projectPath = getcwd(); |
|
| 25 | + $this->_basePath=dirname(__FILE__).'/../../../'; |
|
| 26 | + $this->_projectPath=getcwd(); |
|
| 27 | 27 | |
| 28 | 28 | $this->setName("setup"); |
| 29 | 29 | $this->setDescription("Initialise Magestead project into current working directory"); |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | protected function execute(InputInterface $input, OutputInterface $output) |
| 38 | 38 | { |
| 39 | - $helper = $this->getHelper('question'); |
|
| 40 | - $options = new Options($helper, $input, $output); |
|
| 39 | + $helper=$this->getHelper('question'); |
|
| 40 | + $options=new Options($helper, $input, $output); |
|
| 41 | 41 | |
| 42 | 42 | $this->setupProject($output, $options); |
| 43 | 43 | |
@@ -55,17 +55,17 @@ discard block |
||
| 55 | 55 | protected function copyConfigFiles($source, $target, OutputInterface $output) |
| 56 | 56 | { |
| 57 | 57 | try { |
| 58 | - $progress = new ProgressBar($output, 3720); |
|
| 58 | + $progress=new ProgressBar($output, 3720); |
|
| 59 | 59 | $progress->start(); |
| 60 | 60 | foreach ( |
| 61 | - $iterator = new \RecursiveIteratorIterator( |
|
| 61 | + $iterator=new \RecursiveIteratorIterator( |
|
| 62 | 62 | new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS), |
| 63 | 63 | \RecursiveIteratorIterator::SELF_FIRST) as $item |
| 64 | 64 | ) { |
| 65 | 65 | if ($item->isDir()) { |
| 66 | - mkdir($target . DIRECTORY_SEPARATOR . $iterator->getSubPathName()); |
|
| 66 | + mkdir($target.DIRECTORY_SEPARATOR.$iterator->getSubPathName()); |
|
| 67 | 67 | } else { |
| 68 | - copy($item, $target . DIRECTORY_SEPARATOR . $iterator->getSubPathName()); |
|
| 68 | + copy($item, $target.DIRECTORY_SEPARATOR.$iterator->getSubPathName()); |
|
| 69 | 69 | } |
| 70 | 70 | $progress->advance(); |
| 71 | 71 | } |
@@ -82,18 +82,18 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | protected function configureProject(array $options, OutputInterface $output) |
| 84 | 84 | { |
| 85 | - $this->_magesteadConfig = $this->getConfigFile($output); |
|
| 86 | - |
|
| 87 | - $this->_magesteadConfig['vagrantfile']['vm']['box'] = $options['box']; |
|
| 88 | - $this->_magesteadConfig['vagrantfile']['vm']['box_url'] = $options['box']; |
|
| 89 | - $this->_magesteadConfig['vagrantfile']['vm']['memory'] = $options['memory_limit']; |
|
| 90 | - $this->_magesteadConfig['vagrantfile']['vm']['network']['private_network'] = $options['ip_address']; |
|
| 91 | - $this->_magesteadConfig['magestead']['apps']['mba_12345']['type'] = ($options['app'] == 'magento 2') ? 'magento2' : 'magento'; |
|
| 92 | - $this->_magesteadConfig['magestead']['apps']['mba_12345']['locale'] = $options['locale']; |
|
| 93 | - $this->_magesteadConfig['magestead']['apps']['mba_12345']['default_currency'] = $options['default_currency']; |
|
| 94 | - $this->_magesteadConfig['magestead']['apps']['mba_12345']['base_url'] = $options['base_url']; |
|
| 95 | - $this->_magesteadConfig['magestead']['os'] = $options['os']; |
|
| 96 | - $this->_magesteadConfig['magestead']['server'] = $options['server']; |
|
| 85 | + $this->_magesteadConfig=$this->getConfigFile($output); |
|
| 86 | + |
|
| 87 | + $this->_magesteadConfig['vagrantfile']['vm']['box']=$options['box']; |
|
| 88 | + $this->_magesteadConfig['vagrantfile']['vm']['box_url']=$options['box']; |
|
| 89 | + $this->_magesteadConfig['vagrantfile']['vm']['memory']=$options['memory_limit']; |
|
| 90 | + $this->_magesteadConfig['vagrantfile']['vm']['network']['private_network']=$options['ip_address']; |
|
| 91 | + $this->_magesteadConfig['magestead']['apps']['mba_12345']['type']=($options['app'] == 'magento 2') ? 'magento2' : 'magento'; |
|
| 92 | + $this->_magesteadConfig['magestead']['apps']['mba_12345']['locale']=$options['locale']; |
|
| 93 | + $this->_magesteadConfig['magestead']['apps']['mba_12345']['default_currency']=$options['default_currency']; |
|
| 94 | + $this->_magesteadConfig['magestead']['apps']['mba_12345']['base_url']=$options['base_url']; |
|
| 95 | + $this->_magesteadConfig['magestead']['os']=$options['os']; |
|
| 96 | + $this->_magesteadConfig['magestead']['server']=$options['server']; |
|
| 97 | 97 | |
| 98 | 98 | $this->saveConfigFile($this->_magesteadConfig, $output); |
| 99 | 99 | |
@@ -105,9 +105,9 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | protected function getConfigFile(OutputInterface $output) |
| 107 | 107 | { |
| 108 | - $yaml = new Parser(); |
|
| 108 | + $yaml=new Parser(); |
|
| 109 | 109 | try { |
| 110 | - return $yaml->parse(file_get_contents($this->_projectPath . '/magestead.yaml')); |
|
| 110 | + return $yaml->parse(file_get_contents($this->_projectPath.'/magestead.yaml')); |
|
| 111 | 111 | } catch (ParseException $e) { |
| 112 | 112 | $output->writeln('<error>Unable to parse the YAML string</error>'); |
| 113 | 113 | printf("Unable to parse the YAML string: %s", $e->getMessage()); |
@@ -120,11 +120,11 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | protected function saveConfigFile(array $config, OutputInterface $output) |
| 122 | 122 | { |
| 123 | - $dumper = new Dumper(); |
|
| 124 | - $yaml = $dumper->dump($config, 6); |
|
| 123 | + $dumper=new Dumper(); |
|
| 124 | + $yaml=$dumper->dump($config, 6); |
|
| 125 | 125 | |
| 126 | 126 | try { |
| 127 | - file_put_contents($this->_projectPath . '/magestead.yaml', $yaml); |
|
| 127 | + file_put_contents($this->_projectPath.'/magestead.yaml', $yaml); |
|
| 128 | 128 | } catch (\Exception $e) { |
| 129 | 129 | $output->writeln('<error>Unable to write to the YAML file</error>'); |
| 130 | 130 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | protected function setupProject(OutputInterface $output, $options) |
| 138 | 138 | { |
| 139 | 139 | $output->writeln('<info>Setting up project structure</info>'); |
| 140 | - $provisionFolder = $this->_basePath . "provision"; |
|
| 140 | + $provisionFolder=$this->_basePath."provision"; |
|
| 141 | 141 | $this->copyConfigFiles($provisionFolder, $this->_projectPath, $output); |
| 142 | 142 | $this->configureProject($options->getAllOptions(), $output); |
| 143 | 143 | } |