@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | substr($sha, 0, 8), |
| 95 | 95 | $branch->LastUpdated()->TimeDiff() |
| 96 | 96 | ); |
| 97 | - $branches[$sha . '-' . $name] = $branchValue; |
|
| 97 | + $branches[$sha.'-'.$name] = $branchValue; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // Tags |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | substr($sha, 0, 8), |
| 108 | 108 | $branch->LastUpdated()->TimeDiff() |
| 109 | 109 | ); |
| 110 | - $tags[$sha . '-' . $name] = $tagValue; |
|
| 110 | + $tags[$sha.'-'.$name] = $tagValue; |
|
| 111 | 111 | } |
| 112 | 112 | $tags = array_reverse($tags); |
| 113 | 113 | |
@@ -117,7 +117,6 @@ |
||
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | 119 | * Return data about a particular {@link Member} of the stack for use in API response. |
| 120 | - |
|
| 121 | 120 | * Notes: |
| 122 | 121 | * 1) This method returns null instead of an array if the member doesn't exists anymore |
| 123 | 122 | * 2) 'role' can be null in the response. This is the case of an admin, or an operations |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $startedNice = null; |
| 41 | 41 | $startedAgo = null; |
| 42 | 42 | // we check first, before we do a expensive ->Nice() and ->Ago() |
| 43 | - if(!$deployment->DeployStarted) { |
|
| 43 | + if (!$deployment->DeployStarted) { |
|
| 44 | 44 | $started = $deployment->Created; |
| 45 | 45 | $startedNice = $deployment->obj('Created')->Nice(); |
| 46 | 46 | $startedAgo = $deployment->obj('Created')->Ago(); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | self::$_cache_members[$memberID] = \DataObject::get_by_id("Member", $memberID); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - if(!self::$_cache_members[$memberID]) { |
|
| 148 | + if (!self::$_cache_members[$memberID]) { |
|
| 149 | 149 | return null; |
| 150 | 150 | } |
| 151 | 151 | |
@@ -82,11 +82,11 @@ |
||
| 82 | 82 | |
| 83 | 83 | $base = Director::absoluteBaseURL(); |
| 84 | 84 | return [ |
| 85 | - 'basename' => Director::baseURL() . $this->getCurrentEnvironment()->Link(self::ACTION_OVERVIEW), |
|
| 85 | + 'basename' => Director::baseURL().$this->getCurrentEnvironment()->Link(self::ACTION_OVERVIEW), |
|
| 86 | 86 | 'dispatchers' => [ |
| 87 | - 'git' => $base . $this->getCurrentProject()->Link('git'), |
|
| 88 | - 'deploys' => $base . $this->getCurrentEnvironment()->Link('deploys'), |
|
| 89 | - 'approvals' => $base . $this->getCurrentEnvironment()->Link('approvals') |
|
| 87 | + 'git' => $base.$this->getCurrentProject()->Link('git'), |
|
| 88 | + 'deploys' => $base.$this->getCurrentEnvironment()->Link('deploys'), |
|
| 89 | + 'approvals' => $base.$this->getCurrentEnvironment()->Link('approvals') |
|
| 90 | 90 | ], |
| 91 | 91 | 'api_auth' => [ |
| 92 | 92 | 'name' => $this->getSecurityToken()->getName(), |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $cache = self::get_git_cache(); |
| 163 | 163 | // we only need to clear the tag cache since everything else is cached by SHA, that is for commit and |
| 164 | 164 | // commit message. |
| 165 | - $cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, ['gitonomy', 'tags', 'project_' . $this->ID]); |
|
| 165 | + $cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, ['gitonomy', 'tags', 'project_'.$this->ID]); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /** |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | return true; |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | - return (bool) $this->Environments()->filterByCallback(function ($env) use ($member) { |
|
| 336 | + return (bool) $this->Environments()->filterByCallback(function($env) use ($member) { |
|
| 337 | 337 | return $env->canRestore($member); |
| 338 | 338 | })->Count(); |
| 339 | 339 | } |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | return true; |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | - return (bool) $this->Environments()->filterByCallback(function ($env) use ($member) { |
|
| 357 | + return (bool) $this->Environments()->filterByCallback(function($env) use ($member) { |
|
| 358 | 358 | return $env->canBackup($member); |
| 359 | 359 | })->Count(); |
| 360 | 360 | } |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | return true; |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | - return (bool) $this->Environments()->filterByCallback(function ($env) use ($member) { |
|
| 378 | + return (bool) $this->Environments()->filterByCallback(function($env) use ($member) { |
|
| 379 | 379 | return $env->canUploadArchive($member); |
| 380 | 380 | })->Count(); |
| 381 | 381 | } |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | return true; |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | - return (bool) $this->Environments()->filterByCallback(function ($env) use ($member) { |
|
| 399 | + return (bool) $this->Environments()->filterByCallback(function($env) use ($member) { |
|
| 400 | 400 | return $env->canDownloadArchive($member); |
| 401 | 401 | })->Count(); |
| 402 | 402 | } |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | // Key-pair is available, use it. |
| 456 | 456 | $processEnv = [ |
| 457 | 457 | 'IDENT_KEY' => $this->getPrivateKeyPath(), |
| 458 | - 'GIT_SSH' => BASE_PATH . "/deploynaut/git-deploy.sh" |
|
| 458 | + 'GIT_SSH' => BASE_PATH."/deploynaut/git-deploy.sh" |
|
| 459 | 459 | ]; |
| 460 | 460 | } else { |
| 461 | 461 | $processEnv = []; |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | |
| 544 | 544 | $currentMember = self::$_current_member_cache; |
| 545 | 545 | return $this->Environments() |
| 546 | - ->filterByCallBack(function ($item) use ($currentMember) { |
|
| 546 | + ->filterByCallBack(function($item) use ($currentMember) { |
|
| 547 | 547 | return $item->canView($currentMember); |
| 548 | 548 | }); |
| 549 | 549 | } |
@@ -562,14 +562,14 @@ discard block |
||
| 562 | 562 | * @return false|DNDeployment |
| 563 | 563 | */ |
| 564 | 564 | public function currentBuilds() { |
| 565 | - if (!isset(self::$relation_cache['currentBuilds.' . $this->ID])) { |
|
| 565 | + if (!isset(self::$relation_cache['currentBuilds.'.$this->ID])) { |
|
| 566 | 566 | $currentBuilds = []; |
| 567 | 567 | foreach ($this->Environments() as $env) { |
| 568 | 568 | $currentBuilds[$env->Name] = $env->CurrentBuild(); |
| 569 | 569 | } |
| 570 | - self::$relation_cache['currentBuilds.' . $this->ID] = $currentBuilds; |
|
| 570 | + self::$relation_cache['currentBuilds.'.$this->ID] = $currentBuilds; |
|
| 571 | 571 | } |
| 572 | - return self::$relation_cache['currentBuilds.' . $this->ID]; |
|
| 572 | + return self::$relation_cache['currentBuilds.'.$this->ID]; |
|
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | /** |
@@ -823,7 +823,7 @@ discard block |
||
| 823 | 823 | */ |
| 824 | 824 | public function getPublicKeyPath() { |
| 825 | 825 | if ($privateKey = $this->getPrivateKeyPath()) { |
| 826 | - return $privateKey . '.pub'; |
|
| 826 | + return $privateKey.'.pub'; |
|
| 827 | 827 | } |
| 828 | 828 | return null; |
| 829 | 829 | } |
@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | if (!empty($keyDir)) { |
| 839 | 839 | $filter = FileNameFilter::create(); |
| 840 | 840 | $name = $filter->filter($this->Name); |
| 841 | - return $keyDir . '/' . $name; |
|
| 841 | + return $keyDir.'/'.$name; |
|
| 842 | 842 | } |
| 843 | 843 | return null; |
| 844 | 844 | } |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | $filter = FileNameFilter::create(); |
| 858 | 858 | $name = $filter->filter($this->Name); |
| 859 | 859 | |
| 860 | - return $this->DNData()->getKeyDir() . '/' . $name; |
|
| 860 | + return $this->DNData()->getKeyDir().'/'.$name; |
|
| 861 | 861 | } |
| 862 | 862 | |
| 863 | 863 | /** |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | /* Look for each whitelisted hostname */ |
| 884 | 884 | foreach ($interfaces as $host => $interface) { |
| 885 | 885 | /* See if the CVS Path is for this hostname, followed by some junk (maybe a port), then the path */ |
| 886 | - if (preg_match('{^[^.]*' . $host . '(.*?)([/a-zA-Z].+)}', $this->CVSPath, $match)) { |
|
| 886 | + if (preg_match('{^[^.]*'.$host.'(.*?)([/a-zA-Z].+)}', $this->CVSPath, $match)) { |
|
| 887 | 887 | |
| 888 | 888 | $path = $match[2]; |
| 889 | 889 | |
@@ -894,10 +894,10 @@ discard block |
||
| 894 | 894 | $components = explode('.', $host); |
| 895 | 895 | |
| 896 | 896 | foreach ($regex as $pattern => $replacement) { |
| 897 | - $path = preg_replace('/' . $pattern . '/', $replacement, $path); |
|
| 897 | + $path = preg_replace('/'.$pattern.'/', $replacement, $path); |
|
| 898 | 898 | } |
| 899 | 899 | |
| 900 | - $uxurl = Controller::join_links($scheme . '://', $host, $path); |
|
| 900 | + $uxurl = Controller::join_links($scheme.'://', $host, $path); |
|
| 901 | 901 | |
| 902 | 902 | if (array_key_exists('commit', $interface) && $interface['commit'] == false) { |
| 903 | 903 | $commiturl = false; |
@@ -1024,7 +1024,7 @@ discard block |
||
| 1024 | 1024 | // {@see DataObject::extendedCan()} |
| 1025 | 1025 | $isDone = $this->extend('isProjectReady'); |
| 1026 | 1026 | if ($isDone && is_array($isDone)) { |
| 1027 | - $isDone = array_filter($isDone, function ($val) { |
|
| 1027 | + $isDone = array_filter($isDone, function($val) { |
|
| 1028 | 1028 | return !is_null($val); |
| 1029 | 1029 | }); |
| 1030 | 1030 | |
@@ -1109,11 +1109,11 @@ discard block |
||
| 1109 | 1109 | return false; |
| 1110 | 1110 | } |
| 1111 | 1111 | |
| 1112 | - $cachekey = $this->ID . '_commit_' . $sha; |
|
| 1112 | + $cachekey = $this->ID.'_commit_'.$sha; |
|
| 1113 | 1113 | $cache = self::get_git_cache(); |
| 1114 | 1114 | if (!($result = $cache->load($cachekey))) { |
| 1115 | 1115 | $result = $repo->getCommit($sha); |
| 1116 | - $cache->save($result, $cachekey, ['gitonomy', 'commit', 'project_' . $this->ID]); |
|
| 1116 | + $cache->save($result, $cachekey, ['gitonomy', 'commit', 'project_'.$this->ID]); |
|
| 1117 | 1117 | } |
| 1118 | 1118 | return $result; |
| 1119 | 1119 | } |
@@ -1123,11 +1123,11 @@ discard block |
||
| 1123 | 1123 | * @return string |
| 1124 | 1124 | */ |
| 1125 | 1125 | public function getCommitMessage(\Gitonomy\Git\Commit $commit) { |
| 1126 | - $cachekey = $this->ID . '_message_' . $commit->getRevision(); |
|
| 1126 | + $cachekey = $this->ID.'_message_'.$commit->getRevision(); |
|
| 1127 | 1127 | $cache = self::get_git_cache(); |
| 1128 | 1128 | if (!($result = $cache->load($cachekey))) { |
| 1129 | 1129 | $result = $commit->getMessage(); |
| 1130 | - $cache->save($result, $cachekey, ['gitonomy', 'message', 'project_' . $this->ID]); |
|
| 1130 | + $cache->save($result, $cachekey, ['gitonomy', 'message', 'project_'.$this->ID]); |
|
| 1131 | 1131 | } |
| 1132 | 1132 | return $result; |
| 1133 | 1133 | } |
@@ -1139,11 +1139,11 @@ discard block |
||
| 1139 | 1139 | * @return string |
| 1140 | 1140 | */ |
| 1141 | 1141 | public function getCommitSubjectMessage(\Gitonomy\Git\Commit $commit) { |
| 1142 | - $cachekey = $this->ID . '_message_subject' . $commit->getRevision(); |
|
| 1142 | + $cachekey = $this->ID.'_message_subject'.$commit->getRevision(); |
|
| 1143 | 1143 | $cache = self::get_git_cache(); |
| 1144 | 1144 | if (!($result = $cache->load($cachekey))) { |
| 1145 | 1145 | $result = $commit->getSubjectMessage(); |
| 1146 | - $cache->save($result, $cachekey, ['gitonomy', 'message', 'project_' . $this->ID]); |
|
| 1146 | + $cache->save($result, $cachekey, ['gitonomy', 'message', 'project_'.$this->ID]); |
|
| 1147 | 1147 | } |
| 1148 | 1148 | return $result; |
| 1149 | 1149 | } |
@@ -1153,14 +1153,14 @@ discard block |
||
| 1153 | 1153 | * @return mixed |
| 1154 | 1154 | */ |
| 1155 | 1155 | public function getCommitTags(\Gitonomy\Git\Commit $commit) { |
| 1156 | - $cachekey = $this->ID . '_tags_' . $commit->getRevision(); |
|
| 1156 | + $cachekey = $this->ID.'_tags_'.$commit->getRevision(); |
|
| 1157 | 1157 | $cache = self::get_git_cache(); |
| 1158 | 1158 | $result = $cache->load($cachekey); |
| 1159 | 1159 | // we check against false, because in many cases the tag list is an empty array |
| 1160 | 1160 | if ($result === false) { |
| 1161 | 1161 | $repo = $this->getRepository(); |
| 1162 | 1162 | $result = $repo->getReferences()->resolveTags($commit->getRevision()); |
| 1163 | - $cache->save($result, $cachekey, ['gitonomy', 'tags', 'project_' . $this->ID]); |
|
| 1163 | + $cache->save($result, $cachekey, ['gitonomy', 'tags', 'project_'.$this->ID]); |
|
| 1164 | 1164 | } |
| 1165 | 1165 | return $result; |
| 1166 | 1166 | } |