@@ -1,17 +1,17 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$file = "$argv[1]/magento2/app/etc/env.php"; |
|
4 | -$env = include $file; |
|
3 | +$file="$argv[1]/magento2/app/etc/env.php"; |
|
4 | +$env=include $file; |
|
5 | 5 | |
6 | -$env['cache'] = |
|
7 | - array ( |
|
6 | +$env['cache']= |
|
7 | + array( |
|
8 | 8 | 'frontend' => |
9 | - array ( |
|
9 | + array( |
|
10 | 10 | 'default' => |
11 | - array ( |
|
11 | + array( |
|
12 | 12 | 'backend' => 'Cm_Cache_Backend_Redis', |
13 | 13 | 'backend_options' => |
14 | - array ( |
|
14 | + array( |
|
15 | 15 | 'server' => '127.0.0.1', |
16 | 16 | 'port' => '6379', |
17 | 17 | 'persistent' => '', |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | ) |
28 | 28 | ), |
29 | 29 | 'page_cache' => |
30 | - array ( |
|
30 | + array( |
|
31 | 31 | 'backend' => 'Cm_Cache_Backend_Redis', |
32 | 32 | 'backend_options' => |
33 | - array ( |
|
33 | + array( |
|
34 | 34 | 'server' => '127.0.0.1', |
35 | 35 | 'port' => '6379', |
36 | 36 | 'persistent' => '', |
@@ -48,4 +48,4 @@ discard block |
||
48 | 48 | ) |
49 | 49 | ); |
50 | 50 | |
51 | -file_put_contents($file, "<?php \n \n return ".var_export($env,true).";"); |
|
51 | +file_put_contents($file, "<?php \n \n return ".var_export($env, true).";"); |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$file = "/home/vagrant/.composer/auth.json"; |
|
3 | +$file="/home/vagrant/.composer/auth.json"; |
|
4 | 4 | |
5 | -$publicKey = "$argv[1]"; |
|
6 | -$privateKey = "$argv[2]"; |
|
5 | +$publicKey="$argv[1]"; |
|
6 | +$privateKey="$argv[2]"; |
|
7 | 7 | |
8 | -$contents = [ |
|
8 | +$contents=[ |
|
9 | 9 | "http-basic" => [ |
10 | 10 | "repo.magento.com" => [ |
11 | 11 | "username" => $publicKey, |
@@ -16,13 +16,13 @@ |
||
16 | 16 | */ |
17 | 17 | public static function send($message) |
18 | 18 | { |
19 | - $notifier = NotifierFactory::create(); |
|
20 | - $basePath = dirname( __FILE__ ) . '/../../../'; |
|
21 | - $notification = |
|
19 | + $notifier=NotifierFactory::create(); |
|
20 | + $basePath=dirname(__FILE__).'/../../../'; |
|
21 | + $notification= |
|
22 | 22 | (new Notify()) |
23 | 23 | ->setTitle('Magestead') |
24 | 24 | ->setBody($message) |
25 | - ->setIcon($basePath .'assets/magentologo.png') |
|
25 | + ->setIcon($basePath.'assets/magentologo.png') |
|
26 | 26 | ; |
27 | 27 | |
28 | 28 | $notifier->send($notification); |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | */ |
18 | 18 | public function __construct($repoUrl, $projectPath, OutputInterface $output) |
19 | 19 | { |
20 | - $this->_repoUrl = $repoUrl; |
|
21 | - $this->_projectPath = $projectPath; |
|
22 | - $this->_output = $output; |
|
20 | + $this->_repoUrl=$repoUrl; |
|
21 | + $this->_projectPath=$projectPath; |
|
22 | + $this->_output=$output; |
|
23 | 23 | |
24 | 24 | $this->execute($output); |
25 | 25 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function init() |
51 | 51 | { |
52 | - $command = 'git init; git remote add origin ' . $this->_repoUrl; |
|
52 | + $command='git init; git remote add origin '.$this->_repoUrl; |
|
53 | 53 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
54 | 54 | |
55 | 55 | return $this; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function addFiles() |
64 | 64 | { |
65 | - $command = 'git add -A'; |
|
65 | + $command='git add -A'; |
|
66 | 66 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
67 | 67 | |
68 | 68 | return $this; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function commitFiles() |
77 | 77 | { |
78 | - $command = "git commit -m 'Initial commit'"; |
|
78 | + $command="git commit -m 'Initial commit'"; |
|
79 | 79 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
80 | 80 | |
81 | 81 | return $this; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function pushFiles() |
90 | 90 | { |
91 | - $command = "git push -u origin master"; |
|
91 | + $command="git push -u origin master"; |
|
92 | 92 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
93 | 93 | |
94 | 94 | return $this; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public static function verify(array $options, OutputInterface $output) |
16 | 16 | { |
17 | - $hostPlugin = `vagrant plugin list | grep vagrant-hostsupdater`; |
|
17 | + $hostPlugin=`vagrant plugin list | grep vagrant-hostsupdater`; |
|
18 | 18 | if (is_null($hostPlugin)) { |
19 | 19 | self::editHostsInstructions($options, $output); |
20 | 20 | |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | protected static function editHostsInstructions(array $options, OutputInterface $output) |
30 | 30 | { |
31 | 31 | $output->writeln('<comment>NOTE: You will need to add the following to your hosts file!</comment>'); |
32 | - $comment = $options['vagrantfile']['vm']['network']['private_network'] . |
|
33 | - ' ' . $options['magestead']['apps']['mba_12345']['base_url']; |
|
34 | - $output->writeln('<info>' . $comment . '</info>'); |
|
32 | + $comment=$options['vagrantfile']['vm']['network']['private_network']. |
|
33 | + ' '.$options['magestead']['apps']['mba_12345']['base_url']; |
|
34 | + $output->writeln('<info>'.$comment.'</info>'); |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | \ No newline at end of file |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public function __construct(OutputInterface $output) |
17 | 17 | { |
18 | - $this->_projectPath = getcwd(); |
|
19 | - $this->_config = $this->getConfigFile($output); |
|
18 | + $this->_projectPath=getcwd(); |
|
19 | + $this->_config=$this->getConfigFile($output); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | protected function getConfigFile(OutputInterface $output) |
36 | 36 | { |
37 | - $config = new Parser(); |
|
37 | + $config=new Parser(); |
|
38 | 38 | try { |
39 | 39 | return $config->parse($this->readConfigFile()); |
40 | 40 | } catch (ParseException $e) { |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | */ |
51 | 51 | protected function readConfigFile() |
52 | 52 | { |
53 | - if (!file_exists($this->_projectPath . '/magestead.yaml')) { |
|
53 | + if (!file_exists($this->_projectPath.'/magestead.yaml')) { |
|
54 | 54 | throw new MissingConfigFileException('No config file was found, are you in the project root?'); |
55 | 55 | } |
56 | 56 | |
57 | - return file_get_contents($this->_projectPath . '/magestead.yaml'); |
|
57 | + return file_get_contents($this->_projectPath.'/magestead.yaml'); |
|
58 | 58 | } |
59 | 59 | } |
@@ -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 |
@@ -48,27 +48,27 @@ discard block |
||
48 | 48 | */ |
49 | 49 | protected function installMagento(array $options, $projectPath, OutputInterface $output) |
50 | 50 | { |
51 | - $locale = $options['magestead']['apps']['mba_12345']['locale']; |
|
52 | - $db_name = $options['magestead']['apps']['mba_12345']['db_name']; |
|
53 | - $base_url = $options['magestead']['apps']['mba_12345']['base_url']; |
|
54 | - $default_currency = $options['magestead']['apps']['mba_12345']['default_currency']; |
|
51 | + $locale=$options['magestead']['apps']['mba_12345']['locale']; |
|
52 | + $db_name=$options['magestead']['apps']['mba_12345']['db_name']; |
|
53 | + $base_url=$options['magestead']['apps']['mba_12345']['base_url']; |
|
54 | + $default_currency=$options['magestead']['apps']['mba_12345']['default_currency']; |
|
55 | 55 | |
56 | - $install = 'vagrant ssh -c \'cd /var/www/public; php -f install.php -- \ |
|
56 | + $install='vagrant ssh -c \'cd /var/www/public; php -f install.php -- \ |
|
57 | 57 | --license_agreement_accepted "yes" \ |
58 | ---locale "' . $locale . '" \ |
|
58 | +--locale "' . $locale.'" \ |
|
59 | 59 | --timezone "Europe/London" \ |
60 | ---default_currency "' . $default_currency . '" \ |
|
60 | +--default_currency "' . $default_currency.'" \ |
|
61 | 61 | --db_host "localhost" \ |
62 | ---db_name "' . $db_name . '" \ |
|
62 | +--db_name "' . $db_name.'" \ |
|
63 | 63 | --db_user "magestead" \ |
64 | 64 | --db_pass "vagrant" \ |
65 | 65 | --session_save "db" \ |
66 | ---url "http://' . $base_url . '/" \ |
|
66 | +--url "http://' . $base_url.'/" \ |
|
67 | 67 | --use_rewrites "yes" \ |
68 | 68 | --skip_url_validation "yes" \ |
69 | 69 | --use_secure "no" \ |
70 | 70 | --use_secure_admin "no" \ |
71 | ---secure_base_url "http://' . $base_url . '/" \ |
|
71 | +--secure_base_url "http://' . $base_url.'/" \ |
|
72 | 72 | --admin_firstname "RichDynamix" \ |
73 | 73 | --admin_lastname "Magestead" \ |
74 | 74 | --admin_email "[email protected]" \ |
@@ -96,27 +96,27 @@ discard block |
||
96 | 96 | // $output->writeln('<comment>Setting Folder Permissions</comment>'); |
97 | 97 | // new ProcessCommand($command, $projectPath, $output); |
98 | 98 | |
99 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo find var/ -type f -exec chmod 600 {} \;\''; |
|
99 | + $command='vagrant ssh -c \'cd /var/www/public; sudo find var/ -type f -exec chmod 600 {} \;\''; |
|
100 | 100 | $output->writeln('<comment>Setting "var" Files Permissions</comment>'); |
101 | 101 | new ProcessCommand($command, $projectPath, $output); |
102 | 102 | |
103 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo find media/ -type f -exec chmod 600 {} \;\''; |
|
103 | + $command='vagrant ssh -c \'cd /var/www/public; sudo find media/ -type f -exec chmod 600 {} \;\''; |
|
104 | 104 | $output->writeln('<comment>Setting "media" Files Permissions</comment>'); |
105 | 105 | new ProcessCommand($command, $projectPath, $output); |
106 | 106 | |
107 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo find var/ -type d -exec chmod 700 {} \;\''; |
|
107 | + $command='vagrant ssh -c \'cd /var/www/public; sudo find var/ -type d -exec chmod 700 {} \;\''; |
|
108 | 108 | $output->writeln('<comment>Setting "var" Folder Permissions</comment>'); |
109 | 109 | new ProcessCommand($command, $projectPath, $output); |
110 | 110 | |
111 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo find media/ -type d -exec chmod 700 {} \;\''; |
|
111 | + $command='vagrant ssh -c \'cd /var/www/public; sudo find media/ -type d -exec chmod 700 {} \;\''; |
|
112 | 112 | $output->writeln('<comment>Setting "media" Folder Permissions</comment>'); |
113 | 113 | new ProcessCommand($command, $projectPath, $output); |
114 | 114 | |
115 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 700 includes;\''; |
|
115 | + $command='vagrant ssh -c \'cd /var/www/public; sudo chmod 700 includes;\''; |
|
116 | 116 | $output->writeln('<comment>Setting "includes" Permissions</comment>'); |
117 | 117 | new ProcessCommand($command, $projectPath, $output); |
118 | 118 | |
119 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 600 includes/config.php;\''; |
|
119 | + $command='vagrant ssh -c \'cd /var/www/public; sudo chmod 600 includes/config.php;\''; |
|
120 | 120 | $output->writeln('<comment>Setting "includes/config.php" Permissions</comment>'); |
121 | 121 | new ProcessCommand($command, $projectPath, $output); |
122 | 122 | } |
@@ -127,11 +127,11 @@ discard block |
||
127 | 127 | */ |
128 | 128 | protected function installMagerun($projectPath, OutputInterface $output) |
129 | 129 | { |
130 | - $command = 'vagrant ssh -c \'cd /var/www/bin; sudo wget https://files.magerun.net/n98-magerun.phar;\''; |
|
130 | + $command='vagrant ssh -c \'cd /var/www/bin; sudo wget https://files.magerun.net/n98-magerun.phar;\''; |
|
131 | 131 | $output->writeln('<info>Downloading Magerun</info>'); |
132 | 132 | new ProcessCommand($command, $projectPath, $output); |
133 | 133 | |
134 | - $command = 'vagrant ssh -c \'cd /var/www/bin; sudo chmod +x ./n98-magerun.phar;\''; |
|
134 | + $command='vagrant ssh -c \'cd /var/www/bin; sudo chmod +x ./n98-magerun.phar;\''; |
|
135 | 135 | $output->writeln('<comment>Setting Magerun Permissions</comment>'); |
136 | 136 | new ProcessCommand($command, $projectPath, $output); |
137 | 137 | } |
@@ -143,21 +143,21 @@ discard block |
||
143 | 143 | */ |
144 | 144 | protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) |
145 | 145 | { |
146 | - $command = 'vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar index:reindex:all;\''; |
|
146 | + $command='vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar index:reindex:all;\''; |
|
147 | 147 | $output->writeln('<comment>Reindexing Tables</comment>'); |
148 | 148 | new ProcessCommand($command, $projectPath, $output); |
149 | 149 | |
150 | - $command = 'vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar cache:enable;\''; |
|
150 | + $command='vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar cache:enable;\''; |
|
151 | 151 | $output->writeln('<comment>Enabling All Cache</comment>'); |
152 | 152 | new ProcessCommand($command, $projectPath, $output); |
153 | 153 | |
154 | - $command = 'vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar cache:flush;\''; |
|
154 | + $command='vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar cache:flush;\''; |
|
155 | 155 | $output->writeln('<comment>Flushing All Cache</comment>'); |
156 | 156 | new ProcessCommand($command, $projectPath, $output); |
157 | 157 | |
158 | 158 | $this->processVcs($options, $projectPath, $output); |
159 | 159 | |
160 | - $command = 'vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar sys:check;\''; |
|
160 | + $command='vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar sys:check;\''; |
|
161 | 161 | $output->writeln('<comment>System Check</comment>'); |
162 | 162 | new ProcessCommand($command, $projectPath, $output); |
163 | 163 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | protected function showCredentials(array $options, OutputInterface $output) |
170 | 170 | { |
171 | 171 | $output->writeln('<info>SUCCESS: Magestead has finished installing Magento!</info>'); |
172 | - $table = new Table($output); |
|
172 | + $table=new Table($output); |
|
173 | 173 | $table |
174 | 174 | ->setHeaders(['Username', 'Password', 'Base URL']) |
175 | 175 | ->setRows([ |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | protected function processVcs(array $options, $projectPath, OutputInterface $output) |
190 | 190 | { |
191 | 191 | if (!empty($options['repo_url'])) { |
192 | - copy($projectPath . "/puphpet/magestead/magento/stubs/gitignore.tmp", $projectPath . "/.gitignore"); |
|
192 | + copy($projectPath."/puphpet/magestead/magento/stubs/gitignore.tmp", $projectPath."/.gitignore"); |
|
193 | 193 | return new VersionControl($options['repo_url'], $projectPath, $output); |
194 | 194 | } |
195 | 195 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | protected function composerInstall($projectPath, OutputInterface $output) |
202 | 202 | { |
203 | - copy($projectPath . "/puphpet/magestead/magento/stubs/composer.tmp", $projectPath . "/composer.json"); |
|
203 | + copy($projectPath."/puphpet/magestead/magento/stubs/composer.tmp", $projectPath."/composer.json"); |
|
204 | 204 | new ProcessCommand('composer install', $projectPath, $output); |
205 | 205 | } |
206 | 206 | |
@@ -218,30 +218,30 @@ discard block |
||
218 | 218 | */ |
219 | 219 | protected function updateConfigXml($projectPath) |
220 | 220 | { |
221 | - $localFile = '/public/app/etc/local.xml'; |
|
222 | - $localXml = file_get_contents($projectPath . $localFile); |
|
223 | - |
|
224 | - $config = new \SimpleXMLElement($localXml); |
|
225 | - $config->global[0]->redis_session[0]->host = '127.0.0.1'; |
|
226 | - $config->global[0]->redis_session[0]->port = '6379'; |
|
227 | - $config->global[0]->redis_session[0]->password = ''; |
|
228 | - $config->global[0]->redis_session[0]->timeout = '2.5'; |
|
229 | - $config->global[0]->redis_session[0]->persistent = ''; |
|
230 | - $config->global[0]->redis_session[0]->db = ''; |
|
231 | - $config->global[0]->redis_session[0]->compression_threshold = '2048'; |
|
232 | - $config->global[0]->redis_session[0]->compression_lib = 'gzip'; |
|
233 | - $config->global[0]->redis_session[0]->log_level = '1'; |
|
234 | - $config->global[0]->redis_session[0]->max_concurrency = '6'; |
|
235 | - $config->global[0]->redis_session[0]->break_after_frontend = '5'; |
|
236 | - $config->global[0]->redis_session[0]->break_after_adminhtml = '30'; |
|
237 | - $config->global[0]->redis_session[0]->first_lifetime = '600'; |
|
238 | - $config->global[0]->redis_session[0]->bot_first_lifetime = '60'; |
|
239 | - $config->global[0]->redis_session[0]->bot_lifetime = '7200'; |
|
240 | - $config->global[0]->redis_session[0]->disable_locking = '0'; |
|
241 | - $config->global[0]->redis_session[0]->min_lifetime = '60'; |
|
242 | - $config->global[0]->redis_session[0]->max_lifetime = '2592000'; |
|
243 | - |
|
244 | - file_put_contents($projectPath . $localFile, $config->asXML()); |
|
221 | + $localFile='/public/app/etc/local.xml'; |
|
222 | + $localXml=file_get_contents($projectPath.$localFile); |
|
223 | + |
|
224 | + $config=new \SimpleXMLElement($localXml); |
|
225 | + $config->global[0]->redis_session[0]->host='127.0.0.1'; |
|
226 | + $config->global[0]->redis_session[0]->port='6379'; |
|
227 | + $config->global[0]->redis_session[0]->password=''; |
|
228 | + $config->global[0]->redis_session[0]->timeout='2.5'; |
|
229 | + $config->global[0]->redis_session[0]->persistent=''; |
|
230 | + $config->global[0]->redis_session[0]->db=''; |
|
231 | + $config->global[0]->redis_session[0]->compression_threshold='2048'; |
|
232 | + $config->global[0]->redis_session[0]->compression_lib='gzip'; |
|
233 | + $config->global[0]->redis_session[0]->log_level='1'; |
|
234 | + $config->global[0]->redis_session[0]->max_concurrency='6'; |
|
235 | + $config->global[0]->redis_session[0]->break_after_frontend='5'; |
|
236 | + $config->global[0]->redis_session[0]->break_after_adminhtml='30'; |
|
237 | + $config->global[0]->redis_session[0]->first_lifetime='600'; |
|
238 | + $config->global[0]->redis_session[0]->bot_first_lifetime='60'; |
|
239 | + $config->global[0]->redis_session[0]->bot_lifetime='7200'; |
|
240 | + $config->global[0]->redis_session[0]->disable_locking='0'; |
|
241 | + $config->global[0]->redis_session[0]->min_lifetime='60'; |
|
242 | + $config->global[0]->redis_session[0]->max_lifetime='2592000'; |
|
243 | + |
|
244 | + file_put_contents($projectPath.$localFile, $config->asXML()); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | /** |
@@ -249,11 +249,11 @@ discard block |
||
249 | 249 | */ |
250 | 250 | protected function activateModule($projectPath) |
251 | 251 | { |
252 | - $moduleFile = '/public/app/etc/modules/Cm_RedisSession.xml'; |
|
253 | - $moduleXml = file_get_contents($projectPath . $moduleFile); |
|
254 | - $config = new \SimpleXMLElement($moduleXml); |
|
255 | - $config->modules[0]->Cm_RedisSession[0]->active = 'true'; |
|
256 | - file_put_contents($projectPath . $moduleFile, $config->asXML()); |
|
252 | + $moduleFile='/public/app/etc/modules/Cm_RedisSession.xml'; |
|
253 | + $moduleXml=file_get_contents($projectPath.$moduleFile); |
|
254 | + $config=new \SimpleXMLElement($moduleXml); |
|
255 | + $config->modules[0]->Cm_RedisSession[0]->active='true'; |
|
256 | + file_put_contents($projectPath.$moduleFile, $config->asXML()); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
@@ -265,10 +265,10 @@ discard block |
||
265 | 265 | protected function configureTestSuites(array $options, $projectPath, OutputInterface $output) |
266 | 266 | { |
267 | 267 | $output->writeln('<info>Configuring PHPSpec & Behat Suites</info>'); |
268 | - $progress = new ProgressBar($output, 2); |
|
268 | + $progress=new ProgressBar($output, 2); |
|
269 | 269 | |
270 | 270 | $progress->start(); |
271 | - copy($projectPath . "/puphpet/magestead/magento/stubs/phpspec.yml", $projectPath . "/phpspec.yml"); |
|
271 | + copy($projectPath."/puphpet/magestead/magento/stubs/phpspec.yml", $projectPath."/phpspec.yml"); |
|
272 | 272 | $progress->advance(); |
273 | 273 | $progress->advance(); |
274 | 274 | // $behat = $this->getBehatConfig($options, $projectPath, $output); |
@@ -287,10 +287,10 @@ discard block |
||
287 | 287 | */ |
288 | 288 | protected function getBehatConfig(array $options, $projectPath, OutputInterface $output) |
289 | 289 | { |
290 | - $yaml = new Parser(); |
|
290 | + $yaml=new Parser(); |
|
291 | 291 | try { |
292 | - $behat = $yaml->parse(file_get_contents($projectPath . "/puphpet/magestead/magento/stubs/behat.yml")); |
|
293 | - $behat['default']['extensions']['MageTest\MagentoExtension\Extension']['base_url'] = $options['base_url']; |
|
292 | + $behat=$yaml->parse(file_get_contents($projectPath."/puphpet/magestead/magento/stubs/behat.yml")); |
|
293 | + $behat['default']['extensions']['MageTest\MagentoExtension\Extension']['base_url']=$options['base_url']; |
|
294 | 294 | return $behat; |
295 | 295 | } catch (ParseException $e) { |
296 | 296 | $output->writeln('<error>Unable to parse the YAML config</error>'); |
@@ -307,10 +307,10 @@ discard block |
||
307 | 307 | */ |
308 | 308 | protected function saveBehatConfig($projectPath, OutputInterface $output, $behat, $progress) |
309 | 309 | { |
310 | - $dumper = new Dumper(); |
|
311 | - $yaml = $dumper->dump($behat, 6); |
|
310 | + $dumper=new Dumper(); |
|
311 | + $yaml=$dumper->dump($behat, 6); |
|
312 | 312 | try { |
313 | - file_put_contents($projectPath . '/behat.yml', $yaml); |
|
313 | + file_put_contents($projectPath.'/behat.yml', $yaml); |
|
314 | 314 | $progress->advance(); |
315 | 315 | } catch (\Exception $e) { |
316 | 316 | $output->writeln('<error>Unable to write to the YAML file</error>'); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | protected function composerInstall($projectPath, OutputInterface $output) |
38 | 38 | { |
39 | 39 | $output->writeln('<info>Installing Magento 2 with Composer</info>'); |
40 | - $command = 'composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition public'; |
|
40 | + $command='composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition public'; |
|
41 | 41 | new ProcessCommand($command, $projectPath, $output); |
42 | 42 | |
43 | 43 | $this->setComposerBinDir($projectPath); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | protected function addPhpSpecPackage($projectPath, OutputInterface $output) |
53 | 53 | { |
54 | 54 | $output->writeln('<comment>Installing PHPSpec</comment>'); |
55 | - $command = 'cd '.$projectPath.'/public; composer require phpspec/phpspec --dev;'; |
|
55 | + $command='cd '.$projectPath.'/public; composer require phpspec/phpspec --dev;'; |
|
56 | 56 | new ProcessCommand($command, $projectPath, $output); |
57 | 57 | |
58 | 58 | $this->setPhpSpecPermissions($projectPath, $output); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | protected function addBehatPackage($projectPath, OutputInterface $output) |
66 | 66 | { |
67 | 67 | $output->writeln('<comment>Installing Behat</comment>'); |
68 | - $command = 'cd '.$projectPath.'/public; composer require behat/behat --dev;'; |
|
68 | + $command='cd '.$projectPath.'/public; composer require behat/behat --dev;'; |
|
69 | 69 | new ProcessCommand($command, $projectPath, $output); |
70 | 70 | |
71 | 71 | $this->setBehatPermissions($projectPath, $output); |
@@ -81,12 +81,12 @@ discard block |
||
81 | 81 | $this->setPermissions($projectPath, $output); |
82 | 82 | |
83 | 83 | $output->writeln('<info>Installing Magento 2 Software</info>'); |
84 | - $locale = $options['magestead']['apps']['mba_12345']['locale']; |
|
85 | - $db_name = $options['magestead']['apps']['mba_12345']['db_name']; |
|
86 | - $base_url = $options['magestead']['apps']['mba_12345']['base_url']; |
|
87 | - $default_currency = $options['magestead']['apps']['mba_12345']['default_currency']; |
|
84 | + $locale=$options['magestead']['apps']['mba_12345']['locale']; |
|
85 | + $db_name=$options['magestead']['apps']['mba_12345']['db_name']; |
|
86 | + $base_url=$options['magestead']['apps']['mba_12345']['base_url']; |
|
87 | + $default_currency=$options['magestead']['apps']['mba_12345']['default_currency']; |
|
88 | 88 | |
89 | - $install = 'vagrant ssh -c \'cd /var/www/public; bin/magento setup:install --base-url=http://'.$base_url.'/ \ |
|
89 | + $install='vagrant ssh -c \'cd /var/www/public; bin/magento setup:install --base-url=http://'.$base_url.'/ \ |
|
90 | 90 | --db-host=localhost \ |
91 | 91 | --db-name='.$db_name.' \ |
92 | 92 | --db-user=magestead \ |
@@ -113,15 +113,15 @@ discard block |
||
113 | 113 | protected function setPermissions($projectPath, OutputInterface $output) |
114 | 114 | { |
115 | 115 | $output->writeln('<info>Setting Permissions</info>'); |
116 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo find . -type d -exec chmod 700 {} \;\''; |
|
116 | + $command='vagrant ssh -c \'cd /var/www/public; sudo find . -type d -exec chmod 700 {} \;\''; |
|
117 | 117 | new ProcessCommand($command, $projectPath, $output); |
118 | 118 | $output->writeln('<comment>Folder Permissions Set</comment>'); |
119 | 119 | |
120 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo find . -type f -exec chmod 600 {} \;\''; |
|
120 | + $command='vagrant ssh -c \'cd /var/www/public; sudo find . -type f -exec chmod 600 {} \;\''; |
|
121 | 121 | new ProcessCommand($command, $projectPath, $output); |
122 | 122 | $output->writeln('<comment>File Permissions Set</comment>'); |
123 | 123 | |
124 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod +x bin/magento\''; |
|
124 | + $command='vagrant ssh -c \'cd /var/www/public; sudo chmod +x bin/magento\''; |
|
125 | 125 | new ProcessCommand($command, $projectPath, $output); |
126 | 126 | $output->writeln('<comment>bin/magento Permissions Set</comment>'); |
127 | 127 | } |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | protected function configureRedis($projectPath, OutputInterface $output) |
134 | 134 | { |
135 | 135 | $output->writeln('<comment>Configuring Redis Cache</comment>'); |
136 | - $file = "$projectPath/public/app/etc/env.php"; |
|
137 | - $env = include $file; |
|
136 | + $file="$projectPath/public/app/etc/env.php"; |
|
137 | + $env=include $file; |
|
138 | 138 | |
139 | - $env['cache'] = [ |
|
139 | + $env['cache']=[ |
|
140 | 140 | 'frontend' => [ |
141 | 141 | 'default' => [ |
142 | 142 | 'backend' => 'Cm_Cache_Backend_Redis', |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | ], |
176 | 176 | ]; |
177 | 177 | |
178 | - file_put_contents($file, "<?php \n \n return ".var_export($env,true).";"); |
|
178 | + file_put_contents($file, "<?php \n \n return ".var_export($env, true).";"); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
@@ -185,11 +185,11 @@ discard block |
||
185 | 185 | */ |
186 | 186 | protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) |
187 | 187 | { |
188 | - $command = 'vagrant ssh -c \'cd /var/www/public; bin/magento indexer:reindex; \''; |
|
188 | + $command='vagrant ssh -c \'cd /var/www/public; bin/magento indexer:reindex; \''; |
|
189 | 189 | $output->writeln('<comment>Reindexing Tables</comment>'); |
190 | 190 | new ProcessCommand($command, $projectPath, $output); |
191 | 191 | |
192 | - $command = 'vagrant ssh -c \'cd /var/www/public; bin/magento cache:flush;\''; |
|
192 | + $command='vagrant ssh -c \'cd /var/www/public; bin/magento cache:flush;\''; |
|
193 | 193 | $output->writeln('<comment>Flushing All Cache</comment>'); |
194 | 194 | new ProcessCommand($command, $projectPath, $output); |
195 | 195 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | protected function showCredentials(array $options, OutputInterface $output) |
205 | 205 | { |
206 | 206 | $output->writeln('<info>SUCCESS: Magestead has finished installing Magento 2!</info>'); |
207 | - $table = new Table($output); |
|
207 | + $table=new Table($output); |
|
208 | 208 | $table |
209 | 209 | ->setHeaders(['Username', 'Password', 'Base URL', 'Admin URI']) |
210 | 210 | ->setRows([ |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | protected function processVcs(array $options, $projectPath, OutputInterface $output) |
225 | 225 | { |
226 | 226 | if (!empty($options['repo_url'])) { |
227 | - copy($projectPath . "/puphpet/magestead/magento2/stubs/gitignore.tmp", $projectPath . "/.gitignore"); |
|
227 | + copy($projectPath."/puphpet/magestead/magento2/stubs/gitignore.tmp", $projectPath."/.gitignore"); |
|
228 | 228 | return new VersionControl($options['repo_url'], $projectPath, $output); |
229 | 229 | } |
230 | 230 | } |
@@ -234,9 +234,9 @@ discard block |
||
234 | 234 | */ |
235 | 235 | protected function setComposerBinDir($projectPath) |
236 | 236 | { |
237 | - $file = "$projectPath/public/composer.json"; |
|
238 | - $composer = json_decode(file_get_contents($file), true); |
|
239 | - $composer['config']['bin-dir'] = 'bin'; |
|
237 | + $file="$projectPath/public/composer.json"; |
|
238 | + $composer=json_decode(file_get_contents($file), true); |
|
239 | + $composer['config']['bin-dir']='bin'; |
|
240 | 240 | file_put_contents($file, json_encode($composer)); |
241 | 241 | } |
242 | 242 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | protected function setPhpSpecPermissions($projectPath, OutputInterface $output) |
248 | 248 | { |
249 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/phpspec; bin/phpspec run\''; |
|
249 | + $command='vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/phpspec; bin/phpspec run\''; |
|
250 | 250 | new ProcessCommand($command, $projectPath, $output); |
251 | 251 | } |
252 | 252 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | */ |
257 | 257 | protected function setBehatPermissions($projectPath, OutputInterface $output) |
258 | 258 | { |
259 | - $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/behat; bin/behat --init\''; |
|
259 | + $command='vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/behat; bin/behat --init\''; |
|
260 | 260 | new ProcessCommand($command, $projectPath, $output); |
261 | 261 | } |
262 | 262 | } |
263 | 263 | \ No newline at end of file |