@@ -130,10 +130,10 @@ |
||
| 130 | 130 | */ |
| 131 | 131 | public function getChangesModificationNeeded() { |
| 132 | 132 | $filtered = []; |
| 133 | - foreach ($this->changes as $change => $details) { |
|
| 134 | - if (array_key_exists('description', $details)) { |
|
| 133 | + foreach($this->changes as $change => $details) { |
|
| 134 | + if(array_key_exists('description', $details)) { |
|
| 135 | 135 | $filtered[$change] = $details; |
| 136 | - } else if ( |
|
| 136 | + } else if( |
|
| 137 | 137 | (array_key_exists('from', $details) || array_key_exists('to', $details)) |
| 138 | 138 | && $details['from'] !== $details['to'] |
| 139 | 139 | ) { |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | class FrontendLink extends DataExtension { |
| 4 | 4 | |
| 5 | 5 | public function updateItemEditForm($form) { |
| 6 | - if ($this->owner->record->hasMethod('Link')) { |
|
| 6 | + if($this->owner->record->hasMethod('Link')) { |
|
| 7 | 7 | $link = sprintf( |
| 8 | 8 | '<a style="margin: 0.5em" target="deploynaut-frontend" href="%s">Preview »</a>', |
| 9 | 9 | $this->owner->record->Link() |
@@ -127,7 +127,7 @@ |
||
| 127 | 127 | curl_setopt($ch, CURLOPT_URL, $test['URL']); |
| 128 | 128 | |
| 129 | 129 | // Allow individual tests to override number of attempts |
| 130 | - $attempts = (int) $this->getConfigSetting('Attempts'); |
|
| 130 | + $attempts = (int)$this->getConfigSetting('Attempts'); |
|
| 131 | 131 | if(!empty($test['Attempts'])) { |
| 132 | 132 | $attempts = $test['Attempts']; |
| 133 | 133 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | return false; |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | - $key = $memberID . '-' . $this->EnvironmentID; |
|
| 232 | + $key = $memberID.'-'.$this->EnvironmentID; |
|
| 233 | 233 | if(!isset(self::$_cache_can_restore[$key])) { |
| 234 | 234 | self::$_cache_can_restore[$key] = $this->Environment()->canUploadArchive($member); |
| 235 | 235 | } |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | return false; |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | - $key = $memberID . '-' . $this->EnvironmentID; |
|
| 253 | + $key = $memberID.'-'.$this->EnvironmentID; |
|
| 254 | 254 | if(!isset(self::$_cache_can_download[$key])) { |
| 255 | 255 | self::$_cache_can_download[$key] = $this->Environment()->canDownloadArchive($member); |
| 256 | 256 | } |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | // Extract database.sql.gz to <workingdir>/database.sql |
| 440 | - if(file_exists($workingDir . DIRECTORY_SEPARATOR . 'database.sql.gz')) { |
|
| 440 | + if(file_exists($workingDir.DIRECTORY_SEPARATOR.'database.sql.gz')) { |
|
| 441 | 441 | $process = new Process('gunzip database.sql.gz', $workingDir); |
| 442 | 442 | $process->setTimeout(3600); |
| 443 | 443 | $process->run(); |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | // Extract assets.tar.gz to <workingdir>/assets/ |
| 451 | - if(file_exists($workingDir . DIRECTORY_SEPARATOR . 'assets.tar.gz')) { |
|
| 451 | + if(file_exists($workingDir.DIRECTORY_SEPARATOR.'assets.tar.gz')) { |
|
| 452 | 452 | $process = new Process('tar xzf assets.tar.gz', $workingDir); |
| 453 | 453 | $process->setTimeout(3600); |
| 454 | 454 | $process->run(); |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | public function getTitle() { |
| 46 | 46 | // Make sure the title includes the subtask |
| 47 | - return parent::getTitle() . ":{$this->Doing}"; |
|
| 47 | + return parent::getTitle().":{$this->Doing}"; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | public function getTitle() { |
| 31 | 31 | // Make sure the title includes the subtask |
| 32 | - return parent::getTitle() . ":{$this->Doing}"; |
|
| 32 | + return parent::getTitle().":{$this->Doing}"; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | public function start() { |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | // Skip deployment for dry run |
| 86 | 86 | if($this->Pipeline()->DryRun) { |
| 87 | - $this->log("[Skipped] Create DNDeployment for SHA " . $pipeline->SHA); |
|
| 87 | + $this->log("[Skipped] Create DNDeployment for SHA ".$pipeline->SHA); |
|
| 88 | 88 | $this->write(); |
| 89 | 89 | return true; |
| 90 | 90 | } |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | public function getTreeTitle() { |
| 77 | - return $this->Title . ' (Status: ' . $this->Status . ')'; |
|
| 77 | + return $this->Title.' (Status: '.$this->Status.')'; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | public function getNiceName() { |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | public static $cache = array(); |
| 8 | 8 | |
| 9 | 9 | public static function getIncludingBranches($commit) { |
| 10 | - $cacheKey = 'getIncludingBranches-' . $commit->getRepository()->getPath() . '-' . $commit->gethash(); |
|
| 10 | + $cacheKey = 'getIncludingBranches-'.$commit->getRepository()->getPath().'-'.$commit->gethash(); |
|
| 11 | 11 | if(!isset(self::$cache[$cacheKey])) { |
| 12 | 12 | self::$cache[$cacheKey] = $commit->getIncludingBranches(); |
| 13 | 13 | } |
@@ -408,10 +408,10 @@ discard block |
||
| 408 | 408 | } |
| 409 | 409 | // Must be logged in to check permissions |
| 410 | 410 | |
| 411 | - if ($this->Usage==='Production' || $this->Usage==='Unspecified') { |
|
| 412 | - if ($this->Project()->allowed(DNRoot::ALLOW_PROD_DEPLOYMENT, $member)) return true; |
|
| 411 | + if($this->Usage === 'Production' || $this->Usage === 'Unspecified') { |
|
| 412 | + if($this->Project()->allowed(DNRoot::ALLOW_PROD_DEPLOYMENT, $member)) return true; |
|
| 413 | 413 | } else { |
| 414 | - if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_DEPLOYMENT, $member)) return true; |
|
| 414 | + if($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_DEPLOYMENT, $member)) return true; |
|
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | return $this->Deployers()->byID($member->ID) |
@@ -443,10 +443,10 @@ discard block |
||
| 443 | 443 | } |
| 444 | 444 | // Must be logged in to check permissions |
| 445 | 445 | |
| 446 | - if ($this->Usage==='Production' || $this->Usage==='Unspecified') { |
|
| 447 | - if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 446 | + if($this->Usage === 'Production' || $this->Usage === 'Unspecified') { |
|
| 447 | + if($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 448 | 448 | } else { |
| 449 | - if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 449 | + if($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | return $this->CanRestoreMembers()->byID($member->ID) |
@@ -474,10 +474,10 @@ discard block |
||
| 474 | 474 | return false; |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | - if ($this->Usage==='Production' || $this->Usage==='Unspecified') { |
|
| 478 | - if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 477 | + if($this->Usage === 'Production' || $this->Usage === 'Unspecified') { |
|
| 478 | + if($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 479 | 479 | } else { |
| 480 | - if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 480 | + if($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | return $this->CanBackupMembers()->byID($member->ID) |
@@ -509,10 +509,10 @@ discard block |
||
| 509 | 509 | } |
| 510 | 510 | // Must be logged in to check permissions |
| 511 | 511 | |
| 512 | - if ($this->Usage==='Production' || $this->Usage==='Unspecified') { |
|
| 513 | - if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 512 | + if($this->Usage === 'Production' || $this->Usage === 'Unspecified') { |
|
| 513 | + if($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 514 | 514 | } else { |
| 515 | - if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 515 | + if($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | return $this->ArchiveUploaders()->byID($member->ID) |
@@ -535,10 +535,10 @@ discard block |
||
| 535 | 535 | } |
| 536 | 536 | // Must be logged in to check permissions |
| 537 | 537 | |
| 538 | - if ($this->Usage==='Production' || $this->Usage==='Unspecified') { |
|
| 539 | - if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 538 | + if($this->Usage === 'Production' || $this->Usage === 'Unspecified') { |
|
| 539 | + if($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 540 | 540 | } else { |
| 541 | - if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 541 | + if($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | return $this->ArchiveDownloaders()->byID($member->ID) |
@@ -604,10 +604,10 @@ discard block |
||
| 604 | 604 | } |
| 605 | 605 | // Must be logged in to check permissions |
| 606 | 606 | |
| 607 | - if ($this->Usage==='Production' || $this->Usage==='Unspecified') { |
|
| 608 | - if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 607 | + if($this->Usage === 'Production' || $this->Usage === 'Unspecified') { |
|
| 608 | + if($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 609 | 609 | } else { |
| 610 | - if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 610 | + if($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 611 | 611 | } |
| 612 | 612 | |
| 613 | 613 | return $this->ArchiveDeleters()->byID($member->ID) |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | * @return string |
| 828 | 828 | */ |
| 829 | 829 | public function Link() { |
| 830 | - return $this->Project()->Link() . "/environment/" . $this->Name; |
|
| 830 | + return $this->Project()->Link()."/environment/".$this->Name; |
|
| 831 | 831 | } |
| 832 | 832 | |
| 833 | 833 | /** |
@@ -972,7 +972,7 @@ discard block |
||
| 972 | 972 | ->buildPermissionField('ArchiveUploaderGroups', 'ArchiveUploaders', $groups, $members) |
| 973 | 973 | ->setTitle('Who can upload?') |
| 974 | 974 | ->setDescription( |
| 975 | - 'Users who can upload archives linked to this environment into Deploynaut.<br />' . |
|
| 975 | + 'Users who can upload archives linked to this environment into Deploynaut.<br />'. |
|
| 976 | 976 | 'Linking them to an environment allows limiting download permissions (see below).' |
| 977 | 977 | ), |
| 978 | 978 | |
@@ -1044,7 +1044,7 @@ discard block |
||
| 1044 | 1044 | // Add actions |
| 1045 | 1045 | $action = new FormAction('check', 'Check Connection'); |
| 1046 | 1046 | $action->setUseButtonTag(true); |
| 1047 | - $dataURL = Director::absoluteBaseURL() . 'naut/api/' . $this->Project()->Name . '/' . $this->Name . '/ping'; |
|
| 1047 | + $dataURL = Director::absoluteBaseURL().'naut/api/'.$this->Project()->Name.'/'.$this->Name.'/ping'; |
|
| 1048 | 1048 | $action->setAttribute('data-url', $dataURL); |
| 1049 | 1049 | $fields->insertBefore($action, 'Name'); |
| 1050 | 1050 | |
@@ -1110,8 +1110,8 @@ discard block |
||
| 1110 | 1110 | */ |
| 1111 | 1111 | public function onBeforeWrite() { |
| 1112 | 1112 | parent::onBeforeWrite(); |
| 1113 | - if($this->Name && $this->Name . '.rb' != $this->Filename) { |
|
| 1114 | - $this->Filename = $this->Name . '.rb'; |
|
| 1113 | + if($this->Name && $this->Name.'.rb' != $this->Filename) { |
|
| 1114 | + $this->Filename = $this->Name.'.rb'; |
|
| 1115 | 1115 | } |
| 1116 | 1116 | $this->checkEnvironmentPath(); |
| 1117 | 1117 | $this->writeConfigFile(); |
@@ -1159,7 +1159,7 @@ discard block |
||
| 1159 | 1159 | && $this->Filename |
| 1160 | 1160 | && $this->CreateEnvConfig |
| 1161 | 1161 | ) { |
| 1162 | - $templateFile = $this->config()->template_file ?: BASE_PATH . '/deploynaut/environment.template'; |
|
| 1162 | + $templateFile = $this->config()->template_file ?: BASE_PATH.'/deploynaut/environment.template'; |
|
| 1163 | 1163 | file_put_contents($this->getConfigFilename(), file_get_contents($templateFile)); |
| 1164 | 1164 | } else if($this->envFileExists() && $this->DeployConfig) { |
| 1165 | 1165 | file_put_contents($this->getConfigFilename(), $this->DeployConfig); |
@@ -1231,7 +1231,7 @@ discard block |
||
| 1231 | 1231 | if(!$this->Filename) { |
| 1232 | 1232 | return ''; |
| 1233 | 1233 | } |
| 1234 | - return $this->DNData()->getEnvironmentDir() . '/' . $this->Project()->Name . '/' . $this->Filename; |
|
| 1234 | + return $this->DNData()->getEnvironmentDir().'/'.$this->Project()->Name.'/'.$this->Filename; |
|
| 1235 | 1235 | } |
| 1236 | 1236 | |
| 1237 | 1237 | /** |
@@ -1247,7 +1247,7 @@ discard block |
||
| 1247 | 1247 | } |
| 1248 | 1248 | $path = pathinfo($name); |
| 1249 | 1249 | if($path) { |
| 1250 | - return $path['dirname'] . '/' . $path['filename'] . '.yml'; |
|
| 1250 | + return $path['dirname'].'/'.$path['filename'].'.yml'; |
|
| 1251 | 1251 | } |
| 1252 | 1252 | } |
| 1253 | 1253 | |