@@ -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, $projectPath, $output); |
| 27 | 26 | $this->installSampleData($options, $projectPath, $output); |
@@ -35,8 +34,7 @@ discard block |
||
| 35 | 34 | * @param $projectPath |
| 36 | 35 | * @param OutputInterface $output |
| 37 | 36 | */ |
| 38 | - protected function composerInstall($projectPath, OutputInterface $output) |
|
| 39 | - { |
|
| 37 | + protected function composerInstall($projectPath, OutputInterface $output) { |
|
| 40 | 38 | $output->writeln('<info>Installing Magento 2 with Composer</info>'); |
| 41 | 39 | $command = 'composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition public'; |
| 42 | 40 | new ProcessCommand($command, $projectPath, $output); |
@@ -50,8 +48,7 @@ discard block |
||
| 50 | 48 | * @param $projectPath |
| 51 | 49 | * @param OutputInterface $output |
| 52 | 50 | */ |
| 53 | - protected function addPhpSpecPackage($projectPath, OutputInterface $output) |
|
| 54 | - { |
|
| 51 | + protected function addPhpSpecPackage($projectPath, OutputInterface $output) { |
|
| 55 | 52 | $output->writeln('<comment>Installing PHPSpec</comment>'); |
| 56 | 53 | $command = 'cd '.$projectPath.'/public; composer require phpspec/phpspec --dev;'; |
| 57 | 54 | new ProcessCommand($command, $projectPath, $output); |
@@ -63,8 +60,7 @@ discard block |
||
| 63 | 60 | * @param $projectPath |
| 64 | 61 | * @param OutputInterface $output |
| 65 | 62 | */ |
| 66 | - protected function addBehatPackage($projectPath, OutputInterface $output) |
|
| 67 | - { |
|
| 63 | + protected function addBehatPackage($projectPath, OutputInterface $output) { |
|
| 68 | 64 | $output->writeln('<comment>Installing Behat</comment>'); |
| 69 | 65 | $command = 'cd '.$projectPath.'/public; composer require behat/behat --dev;'; |
| 70 | 66 | new ProcessCommand($command, $projectPath, $output); |
@@ -77,8 +73,7 @@ discard block |
||
| 77 | 73 | * @param $projectPath |
| 78 | 74 | * @param OutputInterface $output |
| 79 | 75 | */ |
| 80 | - protected function installMagento(array $options, $projectPath, OutputInterface $output) |
|
| 81 | - { |
|
| 76 | + protected function installMagento(array $options, $projectPath, OutputInterface $output) { |
|
| 82 | 77 | $this->setPermissions($projectPath, $output); |
| 83 | 78 | |
| 84 | 79 | $output->writeln('<info>Installing Magento 2 Software</info>'); |
@@ -107,8 +102,7 @@ discard block |
||
| 107 | 102 | new ProcessCommand($install, $projectPath, $output); |
| 108 | 103 | } |
| 109 | 104 | |
| 110 | - protected function installSampleData($options, $projectPath, OutputInterface $output) |
|
| 111 | - { |
|
| 105 | + protected function installSampleData($options, $projectPath, OutputInterface $output) { |
|
| 112 | 106 | if (true === $options['installSampleData']) { |
| 113 | 107 | $output->writeln('<info>Installing Magento 2 Sample Data</info>'); |
| 114 | 108 | $command = 'vagrant ssh -c \'cd /var/www; php bin/magento sampledata:deploy'; |
@@ -120,8 +114,7 @@ discard block |
||
| 120 | 114 | * @param $projectPath |
| 121 | 115 | * @param OutputInterface $output |
| 122 | 116 | */ |
| 123 | - protected function setPermissions($projectPath, OutputInterface $output) |
|
| 124 | - { |
|
| 117 | + protected function setPermissions($projectPath, OutputInterface $output) { |
|
| 125 | 118 | $output->writeln('<info>Setting Permissions</info>'); |
| 126 | 119 | $command = 'vagrant ssh -c \'cd /var/www/public; sudo find . -type d -exec chmod 700 {} \;\''; |
| 127 | 120 | new ProcessCommand($command, $projectPath, $output); |
@@ -140,8 +133,7 @@ discard block |
||
| 140 | 133 | * @param $projectPath |
| 141 | 134 | * @param OutputInterface $output |
| 142 | 135 | */ |
| 143 | - protected function configureRedis($projectPath, OutputInterface $output) |
|
| 144 | - { |
|
| 136 | + protected function configureRedis($projectPath, OutputInterface $output) { |
|
| 145 | 137 | $output->writeln('<comment>Configuring Redis Cache</comment>'); |
| 146 | 138 | $file = "$projectPath/public/app/etc/env.php"; |
| 147 | 139 | $env = include $file; |
@@ -193,8 +185,7 @@ discard block |
||
| 193 | 185 | * @param $projectPath |
| 194 | 186 | * @param OutputInterface $output |
| 195 | 187 | */ |
| 196 | - protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) |
|
| 197 | - { |
|
| 188 | + protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) { |
|
| 198 | 189 | $command = 'vagrant ssh -c \'cd /var/www/public; bin/magento indexer:reindex; \''; |
| 199 | 190 | $output->writeln('<comment>Reindexing Tables</comment>'); |
| 200 | 191 | new ProcessCommand($command, $projectPath, $output); |
@@ -211,8 +202,7 @@ discard block |
||
| 211 | 202 | * @param array $options |
| 212 | 203 | * @param OutputInterface $output |
| 213 | 204 | */ |
| 214 | - protected function showCredentials(array $options, OutputInterface $output) |
|
| 215 | - { |
|
| 205 | + protected function showCredentials(array $options, OutputInterface $output) { |
|
| 216 | 206 | $output->writeln('<info>SUCCESS: Magestead has finished installing Magento 2!</info>'); |
| 217 | 207 | $table = new Table($output); |
| 218 | 208 | $table |
@@ -231,8 +221,7 @@ discard block |
||
| 231 | 221 | * @param OutputInterface $output |
| 232 | 222 | * @return VersionControl|null |
| 233 | 223 | */ |
| 234 | - protected function processVcs(array $options, $projectPath, OutputInterface $output) |
|
| 235 | - { |
|
| 224 | + protected function processVcs(array $options, $projectPath, OutputInterface $output) { |
|
| 236 | 225 | if (!empty($options['repo_url'])) { |
| 237 | 226 | copy($projectPath . "/puphpet/magestead/magento2/stubs/gitignore.tmp", $projectPath . "/.gitignore"); |
| 238 | 227 | return new VersionControl($options['repo_url'], $projectPath, $output); |
@@ -242,8 +231,7 @@ discard block |
||
| 242 | 231 | /** |
| 243 | 232 | * @param $projectPath |
| 244 | 233 | */ |
| 245 | - protected function setComposerBinDir($projectPath) |
|
| 246 | - { |
|
| 234 | + protected function setComposerBinDir($projectPath) { |
|
| 247 | 235 | $file = "$projectPath/public/composer.json"; |
| 248 | 236 | $composer = json_decode(file_get_contents($file), true); |
| 249 | 237 | |
@@ -255,8 +243,7 @@ discard block |
||
| 255 | 243 | * @param $projectPath |
| 256 | 244 | * @param OutputInterface $output |
| 257 | 245 | */ |
| 258 | - protected function setPhpSpecPermissions($projectPath, OutputInterface $output) |
|
| 259 | - { |
|
| 246 | + protected function setPhpSpecPermissions($projectPath, OutputInterface $output) { |
|
| 260 | 247 | $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/phpspec; bin/phpspec run\''; |
| 261 | 248 | new ProcessCommand($command, $projectPath, $output); |
| 262 | 249 | } |
@@ -265,8 +252,7 @@ discard block |
||
| 265 | 252 | * @param $projectPath |
| 266 | 253 | * @param OutputInterface $output |
| 267 | 254 | */ |
| 268 | - protected function setBehatPermissions($projectPath, OutputInterface $output) |
|
| 269 | - { |
|
| 255 | + protected function setBehatPermissions($projectPath, OutputInterface $output) { |
|
| 270 | 256 | $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/behat; bin/behat --init\''; |
| 271 | 257 | new ProcessCommand($command, $projectPath, $output); |
| 272 | 258 | } |
@@ -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 | } |
@@ -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'], |