@@ -50,19 +50,19 @@ |
||
| 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 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | public function LogLink() { |
| 104 | - return $this->Link() . '/log'; |
|
| 104 | + return $this->Link().'/log'; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | public function canView($member = null) { |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | if (!$interface) { |
| 177 | 177 | return null; |
| 178 | 178 | } |
| 179 | - return $interface->CommitURL . '/' . $this->SHA; |
|
| 179 | + return $interface->CommitURL.'/'.$this->SHA; |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | /** |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | return false; |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - $key = $memberID . '-' . $this->EnvironmentID; |
|
| 230 | + $key = $memberID.'-'.$this->EnvironmentID; |
|
| 231 | 231 | if (!isset(self::$_cache_can_restore[$key])) { |
| 232 | 232 | self::$_cache_can_restore[$key] = $this->Environment()->canUploadArchive($member); |
| 233 | 233 | } |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | return false; |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | - $key = $memberID . '-' . $this->EnvironmentID; |
|
| 251 | + $key = $memberID.'-'.$this->EnvironmentID; |
|
| 252 | 252 | if (!isset(self::$_cache_can_download[$key])) { |
| 253 | 253 | self::$_cache_can_download[$key] = $this->Environment()->canDownloadArchive($member); |
| 254 | 254 | } |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | public function validTargetEnvironments() { |
| 314 | 314 | $archive = $this; |
| 315 | 315 | $envs = $this->Environment()->Project()->DNEnvironmentList() |
| 316 | - ->filterByCallback(function ($item) use ($archive) { |
|
| 316 | + ->filterByCallback(function($item) use ($archive) { |
|
| 317 | 317 | return $archive->EnvironmentID != $item->ID && $archive->canMoveTo($item); |
| 318 | 318 | }); |
| 319 | 319 | |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | mkdir($workingDir, 0700, true); |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | - $cleanupFn = function () use ($workingDir) { |
|
| 410 | + $cleanupFn = function() use ($workingDir) { |
|
| 411 | 411 | $process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir))); |
| 412 | 412 | $process->setTimeout(120); |
| 413 | 413 | $process->run(); |
@@ -428,7 +428,7 @@ discard block |
||
| 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(); |
@@ -439,7 +439,7 @@ discard block |
||
| 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(); |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | return true; |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | - return (bool) $this->Environments()->filterByCallback(function ($env) use ($member) { |
|
| 314 | + return (bool)$this->Environments()->filterByCallback(function($env) use ($member) { |
|
| 315 | 315 | return $env->canRestore($member); |
| 316 | 316 | })->Count(); |
| 317 | 317 | } |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | return true; |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | - return (bool) $this->Environments()->filterByCallback(function ($env) use ($member) { |
|
| 335 | + return (bool)$this->Environments()->filterByCallback(function($env) use ($member) { |
|
| 336 | 336 | return $env->canBackup($member); |
| 337 | 337 | })->Count(); |
| 338 | 338 | } |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | return true; |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | - return (bool) $this->Environments()->filterByCallback(function ($env) use ($member) { |
|
| 356 | + return (bool)$this->Environments()->filterByCallback(function($env) use ($member) { |
|
| 357 | 357 | return $env->canUploadArchive($member); |
| 358 | 358 | })->Count(); |
| 359 | 359 | } |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | return true; |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | - return (bool) $this->Environments()->filterByCallback(function ($env) use ($member) { |
|
| 377 | + return (bool)$this->Environments()->filterByCallback(function($env) use ($member) { |
|
| 378 | 378 | return $env->canDownloadArchive($member); |
| 379 | 379 | })->Count(); |
| 380 | 380 | } |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | // Key-pair is available, use it. |
| 434 | 434 | $processEnv = [ |
| 435 | 435 | 'IDENT_KEY' => $this->getPrivateKeyPath(), |
| 436 | - 'GIT_SSH' => BASE_PATH . "/deploynaut/git-deploy.sh" |
|
| 436 | + 'GIT_SSH' => BASE_PATH."/deploynaut/git-deploy.sh" |
|
| 437 | 437 | ]; |
| 438 | 438 | } else { |
| 439 | 439 | $processEnv = []; |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | |
| 522 | 522 | $currentMember = self::$_current_member_cache; |
| 523 | 523 | return $this->Environments() |
| 524 | - ->filterByCallBack(function ($item) use ($currentMember) { |
|
| 524 | + ->filterByCallBack(function($item) use ($currentMember) { |
|
| 525 | 525 | return $item->canView($currentMember); |
| 526 | 526 | }); |
| 527 | 527 | } |
@@ -540,14 +540,14 @@ discard block |
||
| 540 | 540 | * @return false|DNDeployment |
| 541 | 541 | */ |
| 542 | 542 | public function currentBuilds() { |
| 543 | - if (!isset(self::$relation_cache['currentBuilds.' . $this->ID])) { |
|
| 543 | + if (!isset(self::$relation_cache['currentBuilds.'.$this->ID])) { |
|
| 544 | 544 | $currentBuilds = []; |
| 545 | 545 | foreach ($this->Environments() as $env) { |
| 546 | 546 | $currentBuilds[$env->Name] = $env->CurrentBuild(); |
| 547 | 547 | } |
| 548 | - self::$relation_cache['currentBuilds.' . $this->ID] = $currentBuilds; |
|
| 548 | + self::$relation_cache['currentBuilds.'.$this->ID] = $currentBuilds; |
|
| 549 | 549 | } |
| 550 | - return self::$relation_cache['currentBuilds.' . $this->ID]; |
|
| 550 | + return self::$relation_cache['currentBuilds.'.$this->ID]; |
|
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | /** |
@@ -788,7 +788,7 @@ discard block |
||
| 788 | 788 | */ |
| 789 | 789 | public function getPublicKeyPath() { |
| 790 | 790 | if ($privateKey = $this->getPrivateKeyPath()) { |
| 791 | - return $privateKey . '.pub'; |
|
| 791 | + return $privateKey.'.pub'; |
|
| 792 | 792 | } |
| 793 | 793 | return null; |
| 794 | 794 | } |
@@ -803,7 +803,7 @@ discard block |
||
| 803 | 803 | if (!empty($keyDir)) { |
| 804 | 804 | $filter = FileNameFilter::create(); |
| 805 | 805 | $name = $filter->filter($this->Name); |
| 806 | - return $keyDir . '/' . $name; |
|
| 806 | + return $keyDir.'/'.$name; |
|
| 807 | 807 | } |
| 808 | 808 | return null; |
| 809 | 809 | } |
@@ -822,7 +822,7 @@ discard block |
||
| 822 | 822 | $filter = FileNameFilter::create(); |
| 823 | 823 | $name = $filter->filter($this->Name); |
| 824 | 824 | |
| 825 | - return $this->DNData()->getKeyDir() . '/' . $name; |
|
| 825 | + return $this->DNData()->getKeyDir().'/'.$name; |
|
| 826 | 826 | } |
| 827 | 827 | |
| 828 | 828 | /** |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | /* Look for each whitelisted hostname */ |
| 849 | 849 | foreach ($interfaces as $host => $interface) { |
| 850 | 850 | /* See if the CVS Path is for this hostname, followed by some junk (maybe a port), then the path */ |
| 851 | - if (preg_match('{^[^.]*' . $host . '(.*?)([/a-zA-Z].+)}', $this->CVSPath, $match)) { |
|
| 851 | + if (preg_match('{^[^.]*'.$host.'(.*?)([/a-zA-Z].+)}', $this->CVSPath, $match)) { |
|
| 852 | 852 | |
| 853 | 853 | $path = $match[2]; |
| 854 | 854 | |
@@ -859,10 +859,10 @@ discard block |
||
| 859 | 859 | $components = explode('.', $host); |
| 860 | 860 | |
| 861 | 861 | foreach ($regex as $pattern => $replacement) { |
| 862 | - $path = preg_replace('/' . $pattern . '/', $replacement, $path); |
|
| 862 | + $path = preg_replace('/'.$pattern.'/', $replacement, $path); |
|
| 863 | 863 | } |
| 864 | 864 | |
| 865 | - $uxurl = Controller::join_links($scheme . '://', $host, $path); |
|
| 865 | + $uxurl = Controller::join_links($scheme.'://', $host, $path); |
|
| 866 | 866 | |
| 867 | 867 | if (array_key_exists('commit', $interface) && $interface['commit'] == false) { |
| 868 | 868 | $commiturl = false; |
@@ -989,7 +989,7 @@ discard block |
||
| 989 | 989 | // {@see DataObject::extendedCan()} |
| 990 | 990 | $isDone = $this->extend('isProjectReady'); |
| 991 | 991 | if ($isDone && is_array($isDone)) { |
| 992 | - $isDone = array_filter($isDone, function ($val) { |
|
| 992 | + $isDone = array_filter($isDone, function($val) { |
|
| 993 | 993 | return !is_null($val); |
| 994 | 994 | }); |
| 995 | 995 | |