@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | substr($sha, 0, 8), |
| 74 | 74 | $branch->LastUpdated()->TimeDiff() |
| 75 | 75 | ); |
| 76 | - $branches[$sha . '-' . $name] = $branchValue; |
|
| 76 | + $branches[$sha.'-'.$name] = $branchValue; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | // Tags |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | substr($sha, 0, 8), |
| 87 | 87 | $branch->LastUpdated()->TimeDiff() |
| 88 | 88 | ); |
| 89 | - $tags[$sha . '-' . $tag] = $tagValue; |
|
| 89 | + $tags[$sha.'-'.$tag] = $tagValue; |
|
| 90 | 90 | } |
| 91 | 91 | $tags = array_reverse($tags); |
| 92 | 92 | |
@@ -307,10 +307,10 @@ discard block |
||
| 307 | 307 | } |
| 308 | 308 | // Must be logged in to check permissions |
| 309 | 309 | |
| 310 | - if ($this->Usage==='Production' || $this->Usage==='Unspecified') { |
|
| 311 | - if ($this->Project()->allowed(DNRoot::ALLOW_PROD_DEPLOYMENT, $member)) return true; |
|
| 310 | + if($this->Usage === 'Production' || $this->Usage === 'Unspecified') { |
|
| 311 | + if($this->Project()->allowed(DNRoot::ALLOW_PROD_DEPLOYMENT, $member)) return true; |
|
| 312 | 312 | } else { |
| 313 | - if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_DEPLOYMENT, $member)) return true; |
|
| 313 | + if($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_DEPLOYMENT, $member)) return true; |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | return $this->Deployers()->byID($member->ID) |
@@ -342,10 +342,10 @@ discard block |
||
| 342 | 342 | } |
| 343 | 343 | // Must be logged in to check permissions |
| 344 | 344 | |
| 345 | - if ($this->Usage==='Production' || $this->Usage==='Unspecified') { |
|
| 346 | - if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 345 | + if($this->Usage === 'Production' || $this->Usage === 'Unspecified') { |
|
| 346 | + if($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 347 | 347 | } else { |
| 348 | - if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 348 | + if($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | return $this->CanRestoreMembers()->byID($member->ID) |
@@ -373,10 +373,10 @@ discard block |
||
| 373 | 373 | return false; |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | - if ($this->Usage==='Production' || $this->Usage==='Unspecified') { |
|
| 377 | - if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 376 | + if($this->Usage === 'Production' || $this->Usage === 'Unspecified') { |
|
| 377 | + if($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 378 | 378 | } else { |
| 379 | - if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 379 | + if($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | return $this->CanBackupMembers()->byID($member->ID) |
@@ -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_SNAPSHOT, $member)) return true; |
|
| 411 | + if($this->Usage === 'Production' || $this->Usage === 'Unspecified') { |
|
| 412 | + if($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 413 | 413 | } else { |
| 414 | - if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 414 | + if($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | return $this->ArchiveUploaders()->byID($member->ID) |
@@ -434,10 +434,10 @@ discard block |
||
| 434 | 434 | } |
| 435 | 435 | // Must be logged in to check permissions |
| 436 | 436 | |
| 437 | - if ($this->Usage==='Production' || $this->Usage==='Unspecified') { |
|
| 438 | - if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 437 | + if($this->Usage === 'Production' || $this->Usage === 'Unspecified') { |
|
| 438 | + if($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 439 | 439 | } else { |
| 440 | - if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 440 | + if($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | return $this->ArchiveDownloaders()->byID($member->ID) |
@@ -460,10 +460,10 @@ discard block |
||
| 460 | 460 | } |
| 461 | 461 | // Must be logged in to check permissions |
| 462 | 462 | |
| 463 | - if ($this->Usage==='Production' || $this->Usage==='Unspecified') { |
|
| 464 | - if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 463 | + if($this->Usage === 'Production' || $this->Usage === 'Unspecified') { |
|
| 464 | + if($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true; |
|
| 465 | 465 | } else { |
| 466 | - if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 466 | + if($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true; |
|
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | return $this->ArchiveDeleters()->byID($member->ID) |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | * @return string |
| 654 | 654 | */ |
| 655 | 655 | public function Link() { |
| 656 | - return $this->Project()->Link() . "/environment/" . $this->Name; |
|
| 656 | + return $this->Project()->Link()."/environment/".$this->Name; |
|
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | /** |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | ->buildPermissionField('ArchiveUploaderGroups', 'ArchiveUploaders', $groups, $members) |
| 799 | 799 | ->setTitle('Who can upload?') |
| 800 | 800 | ->setDescription( |
| 801 | - 'Users who can upload archives linked to this environment into Deploynaut.<br />' . |
|
| 801 | + 'Users who can upload archives linked to this environment into Deploynaut.<br />'. |
|
| 802 | 802 | 'Linking them to an environment allows limiting download permissions (see below).' |
| 803 | 803 | ), |
| 804 | 804 | |
@@ -845,7 +845,7 @@ discard block |
||
| 845 | 845 | // Add actions |
| 846 | 846 | $action = new FormAction('check', 'Check Connection'); |
| 847 | 847 | $action->setUseButtonTag(true); |
| 848 | - $dataURL = Director::absoluteBaseURL() . 'naut/api/' . $this->Project()->Name . '/' . $this->Name . '/ping'; |
|
| 848 | + $dataURL = Director::absoluteBaseURL().'naut/api/'.$this->Project()->Name.'/'.$this->Name.'/ping'; |
|
| 849 | 849 | $action->setAttribute('data-url', $dataURL); |
| 850 | 850 | $fields->insertBefore($action, 'Name'); |
| 851 | 851 | |
@@ -882,8 +882,8 @@ discard block |
||
| 882 | 882 | */ |
| 883 | 883 | public function onBeforeWrite() { |
| 884 | 884 | parent::onBeforeWrite(); |
| 885 | - if($this->Name && $this->Name . '.rb' != $this->Filename) { |
|
| 886 | - $this->Filename = $this->Name . '.rb'; |
|
| 885 | + if($this->Name && $this->Name.'.rb' != $this->Filename) { |
|
| 886 | + $this->Filename = $this->Name.'.rb'; |
|
| 887 | 887 | } |
| 888 | 888 | $this->checkEnvironmentPath(); |
| 889 | 889 | $this->writeConfigFile(); |
@@ -930,7 +930,7 @@ discard block |
||
| 930 | 930 | && $this->Filename |
| 931 | 931 | && $this->CreateEnvConfig |
| 932 | 932 | ) { |
| 933 | - $templateFile = $this->config()->template_file ?: BASE_PATH . '/deploynaut/environment.template'; |
|
| 933 | + $templateFile = $this->config()->template_file ?: BASE_PATH.'/deploynaut/environment.template'; |
|
| 934 | 934 | file_put_contents($this->getConfigFilename(), file_get_contents($templateFile)); |
| 935 | 935 | } else if($this->envFileExists() && $this->DeployConfig) { |
| 936 | 936 | file_put_contents($this->getConfigFilename(), $this->DeployConfig); |
@@ -985,7 +985,7 @@ discard block |
||
| 985 | 985 | if(!$this->Filename) { |
| 986 | 986 | return ''; |
| 987 | 987 | } |
| 988 | - return $this->DNData()->getEnvironmentDir() . '/' . $this->Project()->Name . '/' . $this->Filename; |
|
| 988 | + return $this->DNData()->getEnvironmentDir().'/'.$this->Project()->Name.'/'.$this->Filename; |
|
| 989 | 989 | } |
| 990 | 990 | |
| 991 | 991 | /** |