@@ -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 |
@@ -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,7 +27,7 @@ discard block |
||
| 27 | 27 | protected $_locale; |
| 28 | 28 | protected $_currency; |
| 29 | 29 | protected $_baseUrl; |
| 30 | - protected $_repoUrl = ''; |
|
| 30 | + protected $_repoUrl=''; |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * Options constructor. |
@@ -81,14 +81,14 @@ discard block |
||
| 81 | 81 | { |
| 82 | 82 | $output->writeln('<comment>Lets configure your project\'s VM</comment>'); |
| 83 | 83 | |
| 84 | - $ipQuestion = new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
|
| 85 | - $this->_ipAddress = strtolower($helper->ask($input, $output, $ipQuestion)); |
|
| 84 | + $ipQuestion=new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
|
| 85 | + $this->_ipAddress=strtolower($helper->ask($input, $output, $ipQuestion)); |
|
| 86 | 86 | |
| 87 | - $cpuQuestion = new Question("How many CPU's would you like to use? (1): ", '1'); |
|
| 88 | - $this->_cpus = strtolower($helper->ask($input, $output, $cpuQuestion)); |
|
| 87 | + $cpuQuestion=new Question("How many CPU's would you like to use? (1): ", '1'); |
|
| 88 | + $this->_cpus=strtolower($helper->ask($input, $output, $cpuQuestion)); |
|
| 89 | 89 | |
| 90 | - $memoryQuestion = new Question("Define the VM memory limit (2048): ", '2048'); |
|
| 91 | - $this->_memorylimit = strtolower($helper->ask($input, $output, $memoryQuestion)); |
|
| 90 | + $memoryQuestion=new Question("Define the VM memory limit (2048): ", '2048'); |
|
| 91 | + $this->_memorylimit=strtolower($helper->ask($input, $output, $memoryQuestion)); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -101,23 +101,23 @@ discard block |
||
| 101 | 101 | { |
| 102 | 102 | $output->writeln('<comment>Lets configure your project\'s application</comment>'); |
| 103 | 103 | if ($this->_phpVer !== '70') { |
| 104 | - $appQuestion = new ChoiceQuestion( |
|
| 104 | + $appQuestion=new ChoiceQuestion( |
|
| 105 | 105 | "Which application do you want to install?", |
| 106 | 106 | ['Magento', 'Magento2'], |
| 107 | 107 | 0 |
| 108 | 108 | ); |
| 109 | 109 | |
| 110 | - $this->_app = strtolower($helper->ask($input, $output, $appQuestion)); |
|
| 110 | + $this->_app=strtolower($helper->ask($input, $output, $appQuestion)); |
|
| 111 | 111 | } |
| 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 | /** |
@@ -142,11 +142,11 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
| 144 | 144 | { |
| 145 | - $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
|
| 146 | - $versioning = $helper->ask($input, $output, $versionControl); |
|
| 145 | + $versionControl=new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
|
| 146 | + $versioning=$helper->ask($input, $output, $versionControl); |
|
| 147 | 147 | if ($versioning) { |
| 148 | - $repoQuestion = new Question("Enter your full GitHub/BitBucket repo URL: ", ''); |
|
| 149 | - $this->_repoUrl = strtolower($helper->ask($input, $output, $repoQuestion)); |
|
| 148 | + $repoQuestion=new Question("Enter your full GitHub/BitBucket repo URL: ", ''); |
|
| 149 | + $this->_repoUrl=strtolower($helper->ask($input, $output, $repoQuestion)); |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
@@ -157,11 +157,11 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | protected function askForAuth($helper, InputInterface $input, OutputInterface $output) |
| 159 | 159 | { |
| 160 | - $username = new Question("Please enter your Magento username (public key): ", ''); |
|
| 161 | - $this->_m2Username = $helper->ask($input, $output, $username); |
|
| 160 | + $username=new Question("Please enter your Magento username (public key): ", ''); |
|
| 161 | + $this->_m2Username=$helper->ask($input, $output, $username); |
|
| 162 | 162 | |
| 163 | - $password = new Question("Please enter your Magento password (private key): ", ''); |
|
| 164 | - $this->_m2Password = $helper->ask($input, $output, $password); |
|
| 163 | + $password=new Question("Please enter your Magento password (private key): ", ''); |
|
| 164 | + $this->_m2Password=$helper->ask($input, $output, $password); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
@@ -172,12 +172,12 @@ discard block |
||
| 172 | 172 | */ |
| 173 | 173 | protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) |
| 174 | 174 | { |
| 175 | - $authFile = $_SERVER['HOME'] . "/.composer/auth.json"; |
|
| 175 | + $authFile=$_SERVER['HOME']."/.composer/auth.json"; |
|
| 176 | 176 | |
| 177 | - $authObj = []; |
|
| 177 | + $authObj=[]; |
|
| 178 | 178 | if (file_exists($authFile)) { |
| 179 | - $authJson = file_get_contents($authFile); |
|
| 180 | - $authObj = (array)json_decode($authJson); |
|
| 179 | + $authJson=file_get_contents($authFile); |
|
| 180 | + $authObj=(array) json_decode($authJson); |
|
| 181 | 181 | |
| 182 | 182 | if (isset($authObj['http-basic']) && isset($authObj['http-basic']->{'repo.magento.com'})) { |
| 183 | 183 | return true; |
@@ -186,10 +186,10 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | $this->askForAuth($helper, $input, $output); |
| 188 | 188 | |
| 189 | - $authObj['http-basic']['repo.magento.com']['username'] = $this->_m2Username; |
|
| 190 | - $authObj['http-basic']['repo.magento.com']['password'] = $this->_m2Password; |
|
| 189 | + $authObj['http-basic']['repo.magento.com']['username']=$this->_m2Username; |
|
| 190 | + $authObj['http-basic']['repo.magento.com']['password']=$this->_m2Password; |
|
| 191 | 191 | |
| 192 | - $authJson = json_encode($authObj); |
|
| 192 | + $authJson=json_encode($authObj); |
|
| 193 | 193 | return file_put_contents($authFile, $authJson); |
| 194 | 194 | } |
| 195 | 195 | |
@@ -201,13 +201,13 @@ discard block |
||
| 201 | 201 | protected function setPhp($helper, InputInterface $input, OutputInterface $output) |
| 202 | 202 | { |
| 203 | 203 | $output->writeln('<info>Keep in mind PHP7 is only available for Magento 2</info>'); |
| 204 | - $phpVerQuestion = new ChoiceQuestion( |
|
| 204 | + $phpVerQuestion=new ChoiceQuestion( |
|
| 205 | 205 | "Which version of PHP should be installed?", |
| 206 | 206 | ['56', '70'], |
| 207 | 207 | 0 |
| 208 | 208 | ); |
| 209 | 209 | |
| 210 | - $this->_phpVer = $helper->ask($input, $output, $phpVerQuestion); |
|
| 210 | + $this->_phpVer=$helper->ask($input, $output, $phpVerQuestion); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /** |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | protected function setVagrantBox() |
| 217 | 217 | { |
| 218 | - $this->_box = self::BOX_PREFIX . $this->_os . "-$this->_server-php$this->_phpVer"; |
|
| 218 | + $this->_box=self::BOX_PREFIX.$this->_os."-$this->_server-php$this->_phpVer"; |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | /** |
@@ -238,13 +238,13 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | protected function setWebServer($helper, InputInterface $input, OutputInterface $output) |
| 240 | 240 | { |
| 241 | - $serverQuestion = new ChoiceQuestion( |
|
| 241 | + $serverQuestion=new ChoiceQuestion( |
|
| 242 | 242 | "Which webserver would you like?", |
| 243 | 243 | ['NGINX', 'Apache'], |
| 244 | 244 | 0 |
| 245 | 245 | ); |
| 246 | 246 | |
| 247 | - $this->_server = strtolower($helper->ask($input, $output, $serverQuestion)); |
|
| 247 | + $this->_server=strtolower($helper->ask($input, $output, $serverQuestion)); |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | /** |
@@ -254,12 +254,12 @@ discard block |
||
| 254 | 254 | */ |
| 255 | 255 | protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) |
| 256 | 256 | { |
| 257 | - $osQuestion = new ChoiceQuestion( |
|
| 257 | + $osQuestion=new ChoiceQuestion( |
|
| 258 | 258 | "Which OS would you like to install?", |
| 259 | 259 | ['CentOS 6.5', 'Ubuntu 14'], |
| 260 | 260 | 0 |
| 261 | 261 | ); |
| 262 | 262 | |
| 263 | - $this->_os = str_replace(' ', '', str_replace('.', '', strtolower($helper->ask($input, $output, $osQuestion)))); |
|
| 263 | + $this->_os=str_replace(' ', '', str_replace('.', '', strtolower($helper->ask($input, $output, $osQuestion)))); |
|
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | \ No newline at end of file |
@@ -36,8 +36,7 @@ discard block |
||
| 36 | 36 | * @param OutputInterface $output |
| 37 | 37 | * @param $project |
| 38 | 38 | */ |
| 39 | - public function __construct($helper, InputInterface $input, OutputInterface $output, $project) |
|
| 40 | - { |
|
| 39 | + public function __construct($helper, InputInterface $input, OutputInterface $output, $project) { |
|
| 41 | 40 | $this->setVagrantSettings($helper, $input, $output); |
| 42 | 41 | |
| 43 | 42 | $this->setServerConfig($helper, $input, $output); |
@@ -52,8 +51,7 @@ discard block |
||
| 52 | 51 | /** |
| 53 | 52 | * @return array |
| 54 | 53 | */ |
| 55 | - public function getAllOptions() |
|
| 56 | - { |
|
| 54 | + public function getAllOptions() { |
|
| 57 | 55 | return [ |
| 58 | 56 | 'app' => $this->_app, |
| 59 | 57 | 'server' => $this->_server, |
@@ -77,8 +75,7 @@ discard block |
||
| 77 | 75 | * @param InputInterface $input |
| 78 | 76 | * @param OutputInterface $output |
| 79 | 77 | */ |
| 80 | - protected function setVagrantSettings($helper, InputInterface $input, OutputInterface $output) |
|
| 81 | - { |
|
| 78 | + protected function setVagrantSettings($helper, InputInterface $input, OutputInterface $output) { |
|
| 82 | 79 | $output->writeln('<comment>Lets configure your project\'s VM</comment>'); |
| 83 | 80 | |
| 84 | 81 | $ipQuestion = new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
@@ -97,8 +94,7 @@ discard block |
||
| 97 | 94 | * @param OutputInterface $output |
| 98 | 95 | * @param $project |
| 99 | 96 | */ |
| 100 | - protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) |
|
| 101 | - { |
|
| 97 | + protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) { |
|
| 102 | 98 | $output->writeln('<comment>Lets configure your project\'s application</comment>'); |
| 103 | 99 | if ($this->_phpVer !== '70') { |
| 104 | 100 | $appQuestion = new ChoiceQuestion( |
@@ -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 | return $this->verifyAuth($helper, $input, $output); |
| 133 | 128 | } |
@@ -140,8 +135,7 @@ discard block |
||
| 140 | 135 | * @param InputInterface $input |
| 141 | 136 | * @param OutputInterface $output |
| 142 | 137 | */ |
| 143 | - protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
|
| 144 | - { |
|
| 138 | + protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) { |
|
| 145 | 139 | $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
| 146 | 140 | $versioning = $helper->ask($input, $output, $versionControl); |
| 147 | 141 | if ($versioning) { |
@@ -155,8 +149,7 @@ discard block |
||
| 155 | 149 | * @param InputInterface $input |
| 156 | 150 | * @param OutputInterface $output |
| 157 | 151 | */ |
| 158 | - protected function askForAuth($helper, InputInterface $input, OutputInterface $output) |
|
| 159 | - { |
|
| 152 | + protected function askForAuth($helper, InputInterface $input, OutputInterface $output) { |
|
| 160 | 153 | $username = new Question("Please enter your Magento username (public key): ", ''); |
| 161 | 154 | $this->_m2Username = $helper->ask($input, $output, $username); |
| 162 | 155 | |
@@ -170,8 +163,7 @@ discard block |
||
| 170 | 163 | * @param OutputInterface $output |
| 171 | 164 | * @return boolean|integer |
| 172 | 165 | */ |
| 173 | - protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) |
|
| 174 | - { |
|
| 166 | + protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) { |
|
| 175 | 167 | $authFile = $_SERVER['HOME'] . "/.composer/auth.json"; |
| 176 | 168 | |
| 177 | 169 | $authObj = []; |
@@ -198,8 +190,7 @@ discard block |
||
| 198 | 190 | * @param InputInterface $input |
| 199 | 191 | * @param OutputInterface $output |
| 200 | 192 | */ |
| 201 | - protected function setPhp($helper, InputInterface $input, OutputInterface $output) |
|
| 202 | - { |
|
| 193 | + protected function setPhp($helper, InputInterface $input, OutputInterface $output) { |
|
| 203 | 194 | $output->writeln('<info>Keep in mind PHP7 is only available for Magento 2</info>'); |
| 204 | 195 | $phpVerQuestion = new ChoiceQuestion( |
| 205 | 196 | "Which version of PHP should be installed?", |
@@ -213,8 +204,7 @@ discard block |
||
| 213 | 204 | /** |
| 214 | 205 | * Set box name from concat user options |
| 215 | 206 | */ |
| 216 | - protected function setVagrantBox() |
|
| 217 | - { |
|
| 207 | + protected function setVagrantBox() { |
|
| 218 | 208 | $this->_box = self::BOX_PREFIX . $this->_os . "-$this->_server-php$this->_phpVer"; |
| 219 | 209 | } |
| 220 | 210 | |
@@ -223,8 +213,7 @@ discard block |
||
| 223 | 213 | * @param InputInterface $input |
| 224 | 214 | * @param OutputInterface $output |
| 225 | 215 | */ |
| 226 | - protected function setServerConfig($helper, InputInterface $input, OutputInterface $output) |
|
| 227 | - { |
|
| 216 | + protected function setServerConfig($helper, InputInterface $input, OutputInterface $output) { |
|
| 228 | 217 | $output->writeln('<comment>Lets configure your server</comment>'); |
| 229 | 218 | $this->setOperatingSystem($helper, $input, $output); |
| 230 | 219 | $this->setWebServer($helper, $input, $output); |
@@ -236,8 +225,7 @@ discard block |
||
| 236 | 225 | * @param InputInterface $input |
| 237 | 226 | * @param OutputInterface $output |
| 238 | 227 | */ |
| 239 | - protected function setWebServer($helper, InputInterface $input, OutputInterface $output) |
|
| 240 | - { |
|
| 228 | + protected function setWebServer($helper, InputInterface $input, OutputInterface $output) { |
|
| 241 | 229 | $serverQuestion = new ChoiceQuestion( |
| 242 | 230 | "Which webserver would you like?", |
| 243 | 231 | ['NGINX', 'Apache'], |
@@ -252,8 +240,7 @@ discard block |
||
| 252 | 240 | * @param InputInterface $input |
| 253 | 241 | * @param OutputInterface $output |
| 254 | 242 | */ |
| 255 | - protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) |
|
| 256 | - { |
|
| 243 | + protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) { |
|
| 257 | 244 | $osQuestion = new ChoiceQuestion( |
| 258 | 245 | "Which OS would you like to install?", |
| 259 | 246 | ['CentOS 6.5', 'Ubuntu 14'], |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | protected function configure() |
| 26 | 26 | { |
| 27 | - $this->_basePath = dirname( __FILE__ ) . '/../../../'; |
|
| 28 | - $this->_projectPath = getcwd(); |
|
| 27 | + $this->_basePath=dirname(__FILE__).'/../../../'; |
|
| 28 | + $this->_projectPath=getcwd(); |
|
| 29 | 29 | |
| 30 | 30 | $this->setName("new"); |
| 31 | 31 | $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); |
|
| 46 | + $helper=$this->getHelper('question'); |
|
| 47 | + $options=new Options($helper, $input, $output, $project); |
|
| 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->getAllOptions(), $output); |
| 156 | 156 | } |
@@ -162,8 +162,8 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | protected function setProject(InputInterface $input) |
| 164 | 164 | { |
| 165 | - $project = $input->getArgument('project'); |
|
| 166 | - $this->_projectPath = $this->_projectPath . '/' . $project; |
|
| 165 | + $project=$input->getArgument('project'); |
|
| 166 | + $this->_projectPath=$this->_projectPath.'/'.$project; |
|
| 167 | 167 | |
| 168 | 168 | |
| 169 | 169 | if (is_dir($this->_projectPath)) { |
@@ -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 | } |