|
94 | 94 |
|
95 | 95 | //setup the configs |
96 | 96 | $cwd = getcwd(); |
97 | | - if(!$request->hasStage('skip-configs')) { |
| 97 | + if (!$request->hasStage('skip-configs')) { |
98 | 98 | CommandLine::system('Setting up config files...'); |
99 | 99 |
|
100 | 100 | $paths = scandir(__DIR__ . '/../template/config'); |
101 | | - foreach($paths as $path) { |
| 101 | + foreach ($paths as $path) { |
102 | 102 | if($path === '.' || $path === '..' || substr($path, -4) !== '.php') { |
103 | 103 | continue; |
104 | 104 | } |
|
154 | 154 | } |
155 | 155 |
|
156 | 156 | //create compiled, log, public/upload, config/schema |
157 | | - if(!$request->hasStage('skip-mkdir')) { |
| 157 | + if (!$request->hasStage('skip-mkdir')) { |
158 | 158 | if (!is_dir($cwd . '/compiled')) { |
159 | 159 | CommandLine::system('Making ' . $cwd . '/compiled'); |
160 | 160 | mkdir($cwd . '/compiled', 0777); |
|
182 | 182 | } |
183 | 183 |
|
184 | 184 | //chmod compiled, log, config, public/upload |
185 | | - if(!$request->hasStage('skip-chmod')) { |
| 185 | + if (!$request->hasStage('skip-chmod')) { |
186 | 186 | // special case for config folder |
187 | 187 | $configDirectories = glob($cwd . '/config/*', GLOB_ONLYDIR); |
188 | 188 |
|
189 | 189 | // map each directories |
190 | | - foreach($configDirectories as $directory) { |
| 190 | + foreach ($configDirectories as $directory) { |
191 | 191 | CommandLine::system('chmoding ' . $directory); |
192 | 192 | chmod($directory, 0777); |
193 | 193 | } |
|
208 | 208 | } |
209 | 209 | } |
210 | 210 |
|
211 | | - if(!$request->hasStage('skip-sql')) { |
| 211 | + if (!$request->hasStage('skip-sql')) { |
212 | 212 | //SQL |
213 | 213 | CommandLine::system('Setting up SQL...'); |
214 | 214 |
|
|
239 | 239 | } |
240 | 240 | } |
241 | 241 |
|
242 | | - if(!$request->hasStage('skip-versioning')) { |
| 242 | + if ($request->hasStage('reinstall-packages')) { |
243 | 243 | // copy the default packages if it doesn't exists |
244 | 244 | if (!$this->package('global')->config('packages')) { |
245 | 245 | // get sample package config |
|
254 | 254 | $packages = $this->package('global')->config('packages'); |
255 | 255 |
|
256 | 256 | // on each packages |
257 | | - foreach($packages as $package => $config) { |
| 257 | + foreach ($packages as $package => $config) { |
258 | 258 | // reset the version so we can re-install again |
259 | 259 | if (isset($config['version'])) { |
260 | 260 | unset($packages[$package]['version']); |
|
264 | 264 | // update the config |
265 | 265 | $this->package('global')->config('packages', $packages); |
266 | 266 | } |
| 267 | + } |
267 | 268 |
|
268 | | - //now run the update |
| 269 | + if (!$request->hasStage('skip-versioning')) { |
| 270 | + //run the update |
269 | 271 | $this->trigger('update', $request, $response); |
270 | 272 | } |
271 | 273 |
|
|
0 commit comments