@@ -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 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | * @return string |
38 | 38 | */ |
39 | 39 | public function LogLink() { |
40 | - return $this->Link() . '/log'; |
|
40 | + return $this->Link().'/log'; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | public function getTitle() { |
115 | - return $this->dbObject('Created')->Nice() . " (Status: {$this->Status})"; |
|
115 | + return $this->dbObject('Created')->Nice()." (Status: {$this->Status})"; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | public function Link() { |
@@ -233,14 +233,14 @@ discard block |
||
233 | 233 | $envName = $this->Environment()->getFullName(); |
234 | 234 | if($this->Direction == 'get') { |
235 | 235 | if($this->Origin == 'ManualUpload') { |
236 | - $description = 'Manual upload of ' . $this->getModeNice() . ' to ' . $envName; |
|
236 | + $description = 'Manual upload of '.$this->getModeNice().' to '.$envName; |
|
237 | 237 | } elseif($this->IsBackupDataTransfer()) { |
238 | - $description = 'Automated backup of ' . $this->getModeNice() . ' from ' . $envName; |
|
238 | + $description = 'Automated backup of '.$this->getModeNice().' from '.$envName; |
|
239 | 239 | } else { |
240 | - $description = 'Backup of ' . $this->getModeNice() . ' to ' . $envName; |
|
240 | + $description = 'Backup of '.$this->getModeNice().' to '.$envName; |
|
241 | 241 | } |
242 | 242 | } else { |
243 | - $description = 'Restore ' . $this->getModeNice() . ' to ' . $envName; |
|
243 | + $description = 'Restore '.$this->getModeNice().' to '.$envName; |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | return $description; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @return string |
69 | 69 | */ |
70 | 70 | public function LogLink() { |
71 | - return $this->Link() . '/log'; |
|
71 | + return $this->Link().'/log'; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | if($env instanceof EnvironmentCreateBackend) { |
191 | 191 | return $env; |
192 | 192 | } else { |
193 | - throw new Exception("Invalid backend: " . $data['EnvironmentType']); |
|
193 | + throw new Exception("Invalid backend: ".$data['EnvironmentType']); |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | return null; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | * Do the actual job by calling the appropiate backend |
32 | 32 | */ |
33 | 33 | public function perform() { |
34 | - echo "[-] PingJob starting" . PHP_EOL; |
|
34 | + echo "[-] PingJob starting".PHP_EOL; |
|
35 | 35 | $log = new DeploynautLogFile($this->args['logfile']); |
36 | 36 | |
37 | 37 | $ping = DNPing::get()->byID($this->args['pingID']); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function setEnvironmentDir($environmentDir) { |
91 | 91 | if($environmentDir[0] != "/") { |
92 | - $environmentDir = BASE_PATH . '/' . $environmentDir; |
|
92 | + $environmentDir = BASE_PATH.'/'.$environmentDir; |
|
93 | 93 | } |
94 | 94 | $this->environmentDir = realpath($environmentDir) ?: $environmentDir; |
95 | 95 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public function setKeyDir($keyDir) { |
112 | 112 | if($keyDir[0] != "/") { |
113 | - $keyDir = BASE_PATH . '/' . $keyDir; |
|
113 | + $keyDir = BASE_PATH.'/'.$keyDir; |
|
114 | 114 | } |
115 | 115 | $this->keyDir = realpath($keyDir) ?: $keyDir; |
116 | 116 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function setSignalDir($signalDir) { |
129 | 129 | if($signalDir[0] != "/") { |
130 | - $signalDir = BASE_PATH . '/' . $signalDir; |
|
130 | + $signalDir = BASE_PATH.'/'.$signalDir; |
|
131 | 131 | } |
132 | 132 | $this->signalDir = realpath($signalDir) ?: $signalDir; |
133 | 133 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | */ |
170 | 170 | public function setDataTransferDir($transferDir) { |
171 | 171 | if($transferDir[0] != "/") { |
172 | - $transferDir = BASE_PATH . '/' . $transferDir; |
|
172 | + $transferDir = BASE_PATH.'/'.$transferDir; |
|
173 | 173 | } |
174 | 174 | if(strpos($transferDir, ASSETS_PATH) === false) { |
175 | 175 | throw new LogicException(sprintf( |
@@ -199,14 +199,14 @@ discard block |
||
199 | 199 | public function getProjectPaths() { |
200 | 200 | $paths = array(); |
201 | 201 | if(!file_exists($this->getEnvironmentDir())) { |
202 | - $eMessage = 'The environment directory ' . $this->getEnvironmentDir() . ' doesn\'t exist. Create it ' |
|
202 | + $eMessage = 'The environment directory '.$this->getEnvironmentDir().' doesn\'t exist. Create it ' |
|
203 | 203 | . 'first and add some projects to it.'; |
204 | 204 | throw new Exception($eMessage); |
205 | 205 | } |
206 | 206 | foreach(scandir($this->getEnvironmentDir()) as $project) { |
207 | 207 | // Exlcude dot-prefixed directories (.git was getting in the way) |
208 | 208 | if(preg_match('/^[^\.]/', $project)) { |
209 | - $path = $this->getEnvironmentDir() . '/' . $project; |
|
209 | + $path = $this->getEnvironmentDir().'/'.$project; |
|
210 | 210 | if(is_dir($path) && $project != '.' && $project != '..') { |
211 | 211 | $paths[] = $project; |
212 | 212 | } |
@@ -221,11 +221,11 @@ discard block |
||
221 | 221 | * Returns an array of paths |
222 | 222 | */ |
223 | 223 | public function getEnvironmentPaths($project) { |
224 | - $baseDir = $this->getEnvironmentDir() . '/' . $project; |
|
224 | + $baseDir = $this->getEnvironmentDir().'/'.$project; |
|
225 | 225 | |
226 | 226 | $paths = array(); |
227 | 227 | if(!file_exists($baseDir)) { |
228 | - throw new Exception('Environment directory ' . $baseDir . ' doesn\'t exist. Create it first.'); |
|
228 | + throw new Exception('Environment directory '.$baseDir.' doesn\'t exist. Create it first.'); |
|
229 | 229 | } |
230 | 230 | // Search the directory for config files. |
231 | 231 | foreach(scandir($baseDir) as $environmentFile) { |
@@ -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 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | // This will ensure jobs can correctly clean themselves up on any type of failure |
11 | 11 | Resque_Event::listen('onFailure', function(Exception $exception, Resque_job $job) { |
12 | 12 | $inst = $job->getInstance(); |
13 | - if($inst instanceof DeploynautJobInterface) { |
|
13 | + if ($inst instanceof DeploynautJobInterface) { |
|
14 | 14 | $inst->onFailure($exception); |
15 | 15 | } |
16 | 16 | }); |
@@ -63,9 +63,9 @@ |
||
63 | 63 | $base = Director::absoluteBaseURL(); |
64 | 64 | return [ |
65 | 65 | 'dispatchers' => [ |
66 | - 'git' => $base . $this->getCurrentProject()->Link('git'), |
|
67 | - 'plan' => $base . $this->getCurrentEnvironment()->Link('plan'), |
|
68 | - 'deploys' => $base . $this->getCurrentEnvironment()->Link('deploys') |
|
66 | + 'git' => $base.$this->getCurrentProject()->Link('git'), |
|
67 | + 'plan' => $base.$this->getCurrentEnvironment()->Link('plan'), |
|
68 | + 'deploys' => $base.$this->getCurrentEnvironment()->Link('deploys') |
|
69 | 69 | ], |
70 | 70 | 'api_auth' => [ |
71 | 71 | 'name' => $this->getSecurityToken()->getName(), |