@@ -9,19 +9,19 @@ discard block |
||
9 | 9 | $remove = true; |
10 | 10 | $dryRun = true; |
11 | 11 | |
12 | - if($request && $request->requestVar('remove') !== null) { |
|
13 | - $remove = (bool)$request->requestVar('remove'); |
|
12 | + if ($request && $request->requestVar('remove') !== null) { |
|
13 | + $remove = (bool) $request->requestVar('remove'); |
|
14 | 14 | } |
15 | 15 | |
16 | - if($request && $request->requestVar('dryrun') !== null) { |
|
17 | - $dryRun = (bool)$request->requestVar('dryrun'); |
|
16 | + if ($request && $request->requestVar('dryrun') !== null) { |
|
17 | + $dryRun = (bool) $request->requestVar('dryrun'); |
|
18 | 18 | } |
19 | 19 | |
20 | - if($dryRun) { |
|
20 | + if ($dryRun) { |
|
21 | 21 | echo "Running in dry run mode, no changes commited, "; |
22 | - echo "the output shows a prediction on what will happen." . PHP_EOL; |
|
23 | - echo "To skip dryrun, run the task like this:" . PHP_EOL; |
|
24 | - echo "./framework/sake dev/tasks/SyncProjectsAndEnvironments dryrun=0" . PHP_EOL . PHP_EOL; |
|
22 | + echo "the output shows a prediction on what will happen.".PHP_EOL; |
|
23 | + echo "To skip dryrun, run the task like this:".PHP_EOL; |
|
24 | + echo "./framework/sake dev/tasks/SyncProjectsAndEnvironments dryrun=0".PHP_EOL.PHP_EOL; |
|
25 | 25 | sleep(3); |
26 | 26 | } |
27 | 27 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | // Sync projects |
32 | 32 | $projects = DNProject::get(); |
33 | - if($remove) { |
|
33 | + if ($remove) { |
|
34 | 34 | $this->echoHeader('Removing obsolete projects'); |
35 | 35 | $this->removeObsoleteProjects($projectPaths, $dryRun); |
36 | 36 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $this->syncProjectPaths($projectPaths, $dryRun); |
39 | 39 | |
40 | 40 | $this->echoHeader('Syncing environment files'); |
41 | - foreach($projects as $project) { |
|
41 | + foreach ($projects as $project) { |
|
42 | 42 | $this->echoHeader($project->Name); |
43 | 43 | // Sync environments for each project |
44 | 44 | $environmentPaths = $data->getEnvironmentPaths($project->Name); |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | }, $paths); |
63 | 63 | |
64 | 64 | $removeList = $list->filter('Filename:not', $basePaths); |
65 | - if($removeList->count() === 0) { |
|
65 | + if ($removeList->count() === 0) { |
|
66 | 66 | return; |
67 | 67 | } |
68 | 68 | |
69 | - foreach($removeList as $remove) { |
|
70 | - $this->message('Removing "' . basename($remove->Name) . '" from db'); |
|
71 | - if(!$dryRun) { |
|
69 | + foreach ($removeList as $remove) { |
|
70 | + $this->message('Removing "'.basename($remove->Name).'" from db'); |
|
71 | + if (!$dryRun) { |
|
72 | 72 | $removeList->remove($remove); |
73 | 73 | } |
74 | 74 | } |
@@ -83,13 +83,13 @@ discard block |
||
83 | 83 | */ |
84 | 84 | protected function removeObsoleteProjects($paths, $dryrun = false) { |
85 | 85 | $removeList = DNProject::get()->filter('Name:not', $paths); |
86 | - if($removeList->count() == 0) { |
|
86 | + if ($removeList->count() == 0) { |
|
87 | 87 | return; |
88 | 88 | } |
89 | 89 | |
90 | - foreach($removeList as $remove) { |
|
91 | - $this->message($remove->Name . ' ' . $remove->Path); |
|
92 | - if(!$dryrun) { |
|
90 | + foreach ($removeList as $remove) { |
|
91 | + $this->message($remove->Name.' '.$remove->Path); |
|
92 | + if (!$dryrun) { |
|
93 | 93 | $removeList->remove($remove); |
94 | 94 | } |
95 | 95 | } |
@@ -106,22 +106,22 @@ discard block |
||
106 | 106 | $list = $project->Environments(); |
107 | 107 | |
108 | 108 | // Normalise paths in DB |
109 | - foreach($list as $item) { |
|
109 | + foreach ($list as $item) { |
|
110 | 110 | $real = realpath($item->Filename); |
111 | - if($real && $real != $item->Filename) { |
|
111 | + if ($real && $real != $item->Filename) { |
|
112 | 112 | $item->Filename = $real; |
113 | 113 | $item->write(); |
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
117 | - foreach($paths as $path) { |
|
117 | + foreach ($paths as $path) { |
|
118 | 118 | $path = basename($path); |
119 | - if($list->filter('Filename', $path)->count()) { |
|
119 | + if ($list->filter('Filename', $path)->count()) { |
|
120 | 120 | continue; |
121 | 121 | } |
122 | 122 | |
123 | - $this->message('Adding "' . basename($path) . '" to db'); |
|
124 | - if(!$dryRun) { |
|
123 | + $this->message('Adding "'.basename($path).'" to db'); |
|
124 | + if (!$dryRun) { |
|
125 | 125 | $environment = DNEnvironment::create_from_path($path); |
126 | 126 | $environment->ProjectID = $project->ID; |
127 | 127 | $environment->write(); |
@@ -136,10 +136,10 @@ discard block |
||
136 | 136 | * @param boolean $dryRun |
137 | 137 | */ |
138 | 138 | public function syncProjectPaths($paths, $dryRun = false) { |
139 | - foreach($paths as $path) { |
|
140 | - if(!DNProject::get()->filter('Name', $path)->count()) { |
|
139 | + foreach ($paths as $path) { |
|
140 | + if (!DNProject::get()->filter('Name', $path)->count()) { |
|
141 | 141 | $this->message($path); |
142 | - if(!$dryRun) { |
|
142 | + if (!$dryRun) { |
|
143 | 143 | DNProject::create_from_path($path)->write(); |
144 | 144 | } |
145 | 145 | } |
@@ -150,20 +150,20 @@ discard block |
||
150 | 150 | * @param string $text |
151 | 151 | */ |
152 | 152 | protected function message($text) { |
153 | - if(PHP_SAPI !== 'cli') { |
|
154 | - $text = '<p>' . $text . '</p>' . PHP_EOL; |
|
153 | + if (PHP_SAPI !== 'cli') { |
|
154 | + $text = '<p>'.$text.'</p>'.PHP_EOL; |
|
155 | 155 | } |
156 | - echo ' - ' . $text . PHP_EOL; |
|
156 | + echo ' - '.$text.PHP_EOL; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
160 | 160 | * @param string $text |
161 | 161 | */ |
162 | 162 | protected function echoHeader($text) { |
163 | - if(PHP_SAPI !== 'cli') { |
|
164 | - echo '<h2>' . $text . '</h2>' . PHP_EOL; |
|
163 | + if (PHP_SAPI !== 'cli') { |
|
164 | + echo '<h2>'.$text.'</h2>'.PHP_EOL; |
|
165 | 165 | } else { |
166 | - echo '# ' . $text . PHP_EOL; |
|
166 | + echo '# '.$text.PHP_EOL; |
|
167 | 167 | } |
168 | 168 | } |
169 | 169 | } |
@@ -50,19 +50,19 @@ discard block |
||
50 | 50 | * @return string |
51 | 51 | */ |
52 | 52 | public function Name() { |
53 | - return (string)htmlentities($this->branch->getName()); |
|
53 | + return (string) htmlentities($this->branch->getName()); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | public function Link() { |
57 | 57 | // Use a get-var for branch so that it can handle unsafe chars better |
58 | - return Controller::join_links($this->project->Link(), 'branch?name=' . urlencode($this->Name())); |
|
58 | + return Controller::join_links($this->project->Link(), 'branch?name='.urlencode($this->Name())); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | 62 | * @return string |
63 | 63 | */ |
64 | 64 | public function SHA() { |
65 | - return (string)htmlentities($this->branch->getCommit()->getHash()); |
|
65 | + return (string) htmlentities($this->branch->getCommit()->getHash()); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function LastUpdated() { |
80 | 80 | |
81 | - if($this->_lastUpdatedCache) { |
|
81 | + if ($this->_lastUpdatedCache) { |
|
82 | 82 | return $this->_lastUpdatedCache; |
83 | 83 | } |
84 | 84 | try { |
85 | 85 | $created = $this->branch->getCommit()->getCommitterDate(); |
86 | - } catch(Exception $e) { |
|
86 | + } catch (Exception $e) { |
|
87 | 87 | //occasionally parsing will fail this is a fallback to make it still work |
88 | 88 | return new SS_Datetime(); |
89 | 89 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @return string |
104 | 104 | */ |
105 | 105 | public function IsOpenByDefault() { |
106 | - if($this->Name() == 'master') { |
|
106 | + if ($this->Name() == 'master') { |
|
107 | 107 | return " open"; |
108 | 108 | } else { |
109 | 109 | return ""; |
@@ -6,8 +6,8 @@ |
||
6 | 6 | */ |
7 | 7 | class SS_Datetimezone extends SS_Datetime { |
8 | 8 | /** |
9 | - * Returns the date in the raw SQL-format specific to a given timezone passed from the Member class, e.g. “2006-01-18 16:32:04” |
|
10 | - */ |
|
9 | + * Returns the date in the raw SQL-format specific to a given timezone passed from the Member class, e.g. “2006-01-18 16:32:04” |
|
10 | + */ |
|
11 | 11 | public function Nice() { |
12 | 12 | //instantiate new DateTime object based off received timestamp in the default timezone |
13 | 13 | $timestamp = new DateTime($this->value, new DateTimeZone(date_default_timezone_get())); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | * Returns the date in the raw SQL-format specific to a given timezone passed from the Member class, e.g. “2006-01-18 16:32:04” |
10 | 10 | */ |
11 | 11 | public function Format($format) { |
12 | - if($this->value){ |
|
12 | + if($this->value) { |
|
13 | 13 | $date = new DateTime($this->value); |
14 | 14 | //if the current user has set a timezone that is not the default then use that |
15 | 15 | $member = Member::currentUser(); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * Returns the date in the raw SQL-format specific to a given timezone passed from the Member class, e.g. “2006-01-18 16:32:04” |
16 | 16 | */ |
17 | 17 | public function Format($format) { |
18 | - if($this->value){ |
|
18 | + if ($this->value) { |
|
19 | 19 | $date = new DateTime($this->value); |
20 | 20 | //if the current user has set a timezone that is not the default then use that |
21 | 21 | $member = $this->getCurrentCachedUser(); |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | */ |
35 | 35 | protected function getCurrentCachedUser() { |
36 | 36 | $memberID = \Member::currentUserID(); |
37 | - if(!$memberID) { |
|
37 | + if (!$memberID) { |
|
38 | 38 | return null; |
39 | 39 | } |
40 | - if(!isset(self::$_cache_members[$memberID])) { |
|
40 | + if (!isset(self::$_cache_members[$memberID])) { |
|
41 | 41 | self::$_cache_members[$memberID] = Member::get()->byId($memberID); |
42 | 42 | } |
43 | 43 | return self::$_cache_members[$memberID]; |
@@ -14,7 +14,7 @@ |
||
14 | 14 | return array_combine($timezones, $timezones); |
15 | 15 | } |
16 | 16 | |
17 | - public function updateCMSFields(FieldList $fields) { |
|
17 | + public function updateCMSFields(FieldList $fields) { |
|
18 | 18 | $fields->removeFieldFromTab('Root', 'Timezone'); |
19 | 19 | $field = DropdownField::create( |
20 | 20 | 'Timezone', |
@@ -19,27 +19,27 @@ |
||
19 | 19 | * |
20 | 20 | */ |
21 | 21 | public function perform() { |
22 | - echo "[-] CreateEnvJob starting" . PHP_EOL; |
|
22 | + echo "[-] CreateEnvJob starting".PHP_EOL; |
|
23 | 23 | |
24 | 24 | $log = new DeploynautLogFile($this->args['logfile']); |
25 | 25 | $envCreate = DNCreateEnvironment::get()->byId($this->args['createID']); |
26 | 26 | |
27 | 27 | // This is a bit icky, but there is no easy way of capturing a failed deploy by using the PHP Resque |
28 | 28 | try { |
29 | - if(!($envCreate && $envCreate->exists())) { |
|
29 | + if (!($envCreate && $envCreate->exists())) { |
|
30 | 30 | throw new RuntimeException(sprintf('Could not find create environment record %s', $args['createID'])); |
31 | 31 | } |
32 | 32 | |
33 | 33 | // This will throw and exception if it fails. |
34 | 34 | $envCreate->createEnvironment(); |
35 | 35 | |
36 | - } catch(Exception $e) { |
|
36 | + } catch (Exception $e) { |
|
37 | 37 | $log->write($e->getMessage()); |
38 | - echo "[-] CreateEnvJob failed" . PHP_EOL; |
|
38 | + echo "[-] CreateEnvJob failed".PHP_EOL; |
|
39 | 39 | throw $e; |
40 | 40 | } |
41 | 41 | $this->updateStatus('Finished'); |
42 | - echo "[-] CreateEnvJob finished" . PHP_EOL; |
|
42 | + echo "[-] CreateEnvJob finished".PHP_EOL; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | public function onBeforeWrite() { |
124 | - if(!$this->AuthorID) { |
|
124 | + if (!$this->AuthorID) { |
|
125 | 125 | $this->AuthorID = Member::currentUserID(); |
126 | 126 | } |
127 | 127 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * @return string The human-readable size of this archive file |
180 | 180 | */ |
181 | 181 | public function FileSize() { |
182 | - if($this->ArchiveFile()->exists()) { |
|
182 | + if ($this->ArchiveFile()->exists()) { |
|
183 | 183 | return $this->ArchiveFile()->getSize(); |
184 | 184 | } else { |
185 | 185 | return "N/A"; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | |
189 | 189 | public function getModeNice() { |
190 | - if($this->Mode == 'all') { |
|
190 | + if ($this->Mode == 'all') { |
|
191 | 191 | return 'database and assets'; |
192 | 192 | } else { |
193 | 193 | return $this->Mode; |
@@ -223,12 +223,12 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public function canRestore($member = null) { |
225 | 225 | $memberID = $member ? $member->ID : Member::currentUserID(); |
226 | - if(!$memberID) { |
|
226 | + if (!$memberID) { |
|
227 | 227 | return false; |
228 | 228 | } |
229 | 229 | |
230 | - $key = $memberID . '-' . $this->EnvironmentID; |
|
231 | - if(!isset(self::$_cache_can_restore[$key])) { |
|
230 | + $key = $memberID.'-'.$this->EnvironmentID; |
|
231 | + if (!isset(self::$_cache_can_restore[$key])) { |
|
232 | 232 | self::$_cache_can_restore[$key] = $this->Environment()->canUploadArchive($member); |
233 | 233 | } |
234 | 234 | |
@@ -244,12 +244,12 @@ discard block |
||
244 | 244 | */ |
245 | 245 | public function canDownload($member = null) { |
246 | 246 | $memberID = $member ? $member->ID : Member::currentUserID(); |
247 | - if(!$memberID) { |
|
247 | + if (!$memberID) { |
|
248 | 248 | return false; |
249 | 249 | } |
250 | 250 | |
251 | - $key = $memberID . '-' . $this->EnvironmentID; |
|
252 | - if(!isset(self::$_cache_can_download[$key])) { |
|
251 | + $key = $memberID.'-'.$this->EnvironmentID; |
|
252 | + if (!isset(self::$_cache_can_download[$key])) { |
|
253 | 253 | self::$_cache_can_download[$key] = $this->Environment()->canDownloadArchive($member); |
254 | 254 | } |
255 | 255 | return self::$_cache_can_download[$key]; |
@@ -274,27 +274,27 @@ discard block |
||
274 | 274 | * @return boolean true if $member can upload archives linked to this environment, false if they can't. |
275 | 275 | */ |
276 | 276 | public function canMoveTo($targetEnv, $member = null) { |
277 | - if($this->Environment()->Project()->ID != $targetEnv->Project()->ID) { |
|
277 | + if ($this->Environment()->Project()->ID != $targetEnv->Project()->ID) { |
|
278 | 278 | // We don't permit moving snapshots between projects at this stage. |
279 | 279 | return false; |
280 | 280 | } |
281 | 281 | |
282 | - if(!$member) { |
|
282 | + if (!$member) { |
|
283 | 283 | $member = Member::currentUser(); |
284 | 284 | } |
285 | 285 | |
286 | 286 | // Must be logged in to check permissions |
287 | - if(!$member) { |
|
287 | + if (!$member) { |
|
288 | 288 | return false; |
289 | 289 | } |
290 | 290 | |
291 | 291 | // Admin can always move. |
292 | - if(Permission::checkMember($member, 'ADMIN')) { |
|
292 | + if (Permission::checkMember($member, 'ADMIN')) { |
|
293 | 293 | return true; |
294 | 294 | } |
295 | 295 | |
296 | 296 | // Checks if the user can actually access the archive. |
297 | - if(!$this->canDownload($member)) { |
|
297 | + if (!$this->canDownload($member)) { |
|
298 | 298 | return false; |
299 | 299 | } |
300 | 300 | |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | * @return bool |
404 | 404 | */ |
405 | 405 | public function extractArchive($workingDir = null) { |
406 | - if(!is_dir($workingDir)) { |
|
406 | + if (!is_dir($workingDir)) { |
|
407 | 407 | mkdir($workingDir, 0700, true); |
408 | 408 | } |
409 | 409 | |
@@ -422,28 +422,28 @@ discard block |
||
422 | 422 | )); |
423 | 423 | $process->setTimeout(3600); |
424 | 424 | $process->run(); |
425 | - if(!$process->isSuccessful()) { |
|
425 | + if (!$process->isSuccessful()) { |
|
426 | 426 | $cleanupFn(); |
427 | 427 | throw new RuntimeException(sprintf('Could not extract the sspak file: %s', $process->getErrorOutput())); |
428 | 428 | } |
429 | 429 | |
430 | 430 | // Extract database.sql.gz to <workingdir>/database.sql |
431 | - if(file_exists($workingDir . DIRECTORY_SEPARATOR . 'database.sql.gz')) { |
|
431 | + if (file_exists($workingDir.DIRECTORY_SEPARATOR.'database.sql.gz')) { |
|
432 | 432 | $process = new AbortableProcess('gunzip database.sql.gz', $workingDir); |
433 | 433 | $process->setTimeout(3600); |
434 | 434 | $process->run(); |
435 | - if(!$process->isSuccessful()) { |
|
435 | + if (!$process->isSuccessful()) { |
|
436 | 436 | $cleanupFn(); |
437 | 437 | throw new RuntimeException(sprintf('Could not extract the db archive: %s', $process->getErrorOutput())); |
438 | 438 | } |
439 | 439 | } |
440 | 440 | |
441 | 441 | // Extract assets.tar.gz to <workingdir>/assets/ |
442 | - if(file_exists($workingDir . DIRECTORY_SEPARATOR . 'assets.tar.gz')) { |
|
442 | + if (file_exists($workingDir.DIRECTORY_SEPARATOR.'assets.tar.gz')) { |
|
443 | 443 | $process = new AbortableProcess('tar xzf assets.tar.gz', $workingDir); |
444 | 444 | $process->setTimeout(3600); |
445 | 445 | $process->run(); |
446 | - if(!$process->isSuccessful()) { |
|
446 | + if (!$process->isSuccessful()) { |
|
447 | 447 | $cleanupFn(); |
448 | 448 | throw new RuntimeException(sprintf('Could not extract the assets archive: %s', $process->getErrorOutput())); |
449 | 449 | } |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | |
468 | 468 | $file = $this->ArchiveFile()->FullPath; |
469 | 469 | |
470 | - if(!is_readable($file)) { |
|
470 | + if (!is_readable($file)) { |
|
471 | 471 | $result->error(sprintf('SSPak file "%s" cannot be read.', $file)); |
472 | 472 | return $result; |
473 | 473 | } |
@@ -475,19 +475,19 @@ discard block |
||
475 | 475 | $process = new AbortableProcess(sprintf('tar -tf %s', escapeshellarg($file))); |
476 | 476 | $process->setTimeout(120); |
477 | 477 | $process->run(); |
478 | - if(!$process->isSuccessful()) { |
|
478 | + if (!$process->isSuccessful()) { |
|
479 | 479 | throw new RuntimeException(sprintf('Could not list files in archive: %s', $process->getErrorOutput())); |
480 | 480 | } |
481 | 481 | |
482 | 482 | $output = explode(PHP_EOL, $process->getOutput()); |
483 | 483 | $files = array_filter($output); |
484 | 484 | |
485 | - if(in_array($mode, array('all', 'db')) && !in_array('database.sql.gz', $files)) { |
|
485 | + if (in_array($mode, array('all', 'db')) && !in_array('database.sql.gz', $files)) { |
|
486 | 486 | $result->error('The snapshot is missing the database.'); |
487 | 487 | return $result; |
488 | 488 | } |
489 | 489 | |
490 | - if(in_array($mode, array('all', 'assets')) && !in_array('assets.tar.gz', $files)) { |
|
490 | + if (in_array($mode, array('all', 'assets')) && !in_array('assets.tar.gz', $files)) { |
|
491 | 491 | $result->error('The snapshot is missing assets.'); |
492 | 492 | return $result; |
493 | 493 | } |
@@ -517,11 +517,11 @@ discard block |
||
517 | 517 | sprintf('find %s -type f -exec chmod 644 {} +', escapeshellarg($workingDir)) |
518 | 518 | ); |
519 | 519 | |
520 | - foreach($fixCmds as $cmd) { |
|
520 | + foreach ($fixCmds as $cmd) { |
|
521 | 521 | $process = new AbortableProcess($cmd); |
522 | 522 | $process->setTimeout(3600); |
523 | 523 | $process->run(); |
524 | - if(!$process->isSuccessful()) { |
|
524 | + if (!$process->isSuccessful()) { |
|
525 | 525 | throw new RuntimeException($process->getErrorOutput()); |
526 | 526 | } |
527 | 527 | } |
@@ -540,18 +540,18 @@ discard block |
||
540 | 540 | */ |
541 | 541 | public function setArchiveFromFiles($workingDir) { |
542 | 542 | $commands = array(); |
543 | - if($this->Mode == 'db') { |
|
544 | - if (file_exists($workingDir . '/database.sql')) { |
|
543 | + if ($this->Mode == 'db') { |
|
544 | + if (file_exists($workingDir.'/database.sql')) { |
|
545 | 545 | $commands[] = 'gzip database.sql'; |
546 | 546 | } |
547 | 547 | $commands[] = sprintf('tar -cf %s database.sql.gz', $this->ArchiveFile()->FullPath); |
548 | 548 | $commands[] = 'rm -f database.sql.gz'; |
549 | - } elseif($this->Mode == 'assets') { |
|
549 | + } elseif ($this->Mode == 'assets') { |
|
550 | 550 | $commands[] = 'GZIP=-1 tar --dereference -czf assets.tar.gz assets'; |
551 | 551 | $commands[] = sprintf('tar -cf %s assets.tar.gz', $this->ArchiveFile()->FullPath); |
552 | 552 | $commands[] = 'rm -f assets.tar.gz'; |
553 | 553 | } else { |
554 | - if (file_exists($workingDir . '/database.sql')) { |
|
554 | + if (file_exists($workingDir.'/database.sql')) { |
|
555 | 555 | $commands[] = 'gzip database.sql'; |
556 | 556 | } |
557 | 557 | $commands[] = 'GZIP=-1 tar --dereference -czf assets.tar.gz assets'; |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | $process = new AbortableProcess(implode(' && ', $commands), $workingDir); |
563 | 563 | $process->setTimeout(3600); |
564 | 564 | $process->run(); |
565 | - if(!$process->isSuccessful()) { |
|
565 | + if (!$process->isSuccessful()) { |
|
566 | 566 | throw new RuntimeException($process->getErrorOutput()); |
567 | 567 | } |
568 | 568 |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | public function run($request) { |
6 | 6 | $log = function($message) { |
7 | - $message = sprintf('[%s] ', date('Y-m-d H:i:s')) . $message; |
|
8 | - echo $message . PHP_EOL; |
|
7 | + $message = sprintf('[%s] ', date('Y-m-d H:i:s')).$message; |
|
8 | + echo $message.PHP_EOL; |
|
9 | 9 | }; |
10 | 10 | |
11 | 11 | if (!Director::is_cli()) { |
@@ -12,8 +12,8 @@ |
||
12 | 12 | } |
13 | 13 | |
14 | 14 | public function __get($name) { |
15 | - if (method_exists($this, 'get' . $name)) { |
|
16 | - return $this->{'get' . $name}(); |
|
15 | + if (method_exists($this, 'get'.$name)) { |
|
16 | + return $this->{'get'.$name}(); |
|
17 | 17 | } |
18 | 18 | return $this->$name; |
19 | 19 | } |
@@ -12,8 +12,8 @@ |
||
12 | 12 | } |
13 | 13 | |
14 | 14 | public function __get($name) { |
15 | - if (method_exists($this, 'get' . $name)) { |
|
16 | - return $this->{'get' . $name}(); |
|
15 | + if (method_exists($this, 'get'.$name)) { |
|
16 | + return $this->{'get'.$name}(); |
|
17 | 17 | } |
18 | 18 | return $this->$name; |
19 | 19 | } |