@@ -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'], |
@@ -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 | } |
@@ -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 |
@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | * Config constructor. |
| 22 | 22 | * @param OutputInterface $output |
| 23 | 23 | */ |
| 24 | - public function __construct(OutputInterface $output) |
|
| 25 | - { |
|
| 24 | + public function __construct(OutputInterface $output) { |
|
| 26 | 25 | $this->_projectPath = getcwd(); |
| 27 | 26 | $this->output = $output; |
| 28 | 27 | } |
@@ -31,8 +30,7 @@ discard block |
||
| 31 | 30 | * @param $name |
| 32 | 31 | * @return mixed |
| 33 | 32 | */ |
| 34 | - function __get($name) |
|
| 35 | - { |
|
| 33 | + function __get($name) { |
|
| 36 | 34 | $this->_config = $this->getConfigFile($this->output); |
| 37 | 35 | return $this->_config['magestead']['apps']['mba_12345'][$name]; |
| 38 | 36 | } |
@@ -41,8 +39,7 @@ discard block |
||
| 41 | 39 | * @param OutputInterface $output |
| 42 | 40 | * @return bool|mixed |
| 43 | 41 | */ |
| 44 | - protected function getConfigFile(OutputInterface $output) |
|
| 45 | - { |
|
| 42 | + protected function getConfigFile(OutputInterface $output) { |
|
| 46 | 43 | $config = new Parser(); |
| 47 | 44 | try { |
| 48 | 45 | return $config->parse($this->readConfigFile()); |
@@ -57,8 +54,7 @@ discard block |
||
| 57 | 54 | * @return string |
| 58 | 55 | * @throws MissingConfigFileException |
| 59 | 56 | */ |
| 60 | - protected function readConfigFile() |
|
| 61 | - { |
|
| 57 | + protected function readConfigFile() { |
|
| 62 | 58 | if (!file_exists($this->_projectPath . '/magestead.yaml')) { |
| 63 | 59 | throw new MissingConfigFileException('No config file was found, are you in the project root?'); |
| 64 | 60 | } |
@@ -72,8 +68,7 @@ discard block |
||
| 72 | 68 | * @return string |
| 73 | 69 | * @throws MissingComposerHomeException |
| 74 | 70 | */ |
| 75 | - public function getComposerHomeDir() |
|
| 76 | - { |
|
| 71 | + public function getComposerHomeDir() { |
|
| 77 | 72 | $composerConfig = shell_exec('composer config --list --global | grep home'); |
| 78 | 73 | |
| 79 | 74 | if (is_null($composerConfig)) { |