@@ -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; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * @return string |
40 | 40 | */ |
41 | 41 | public function getRawFilePath() { |
42 | - return $this->basePath . '/' . $this->logFile; |
|
42 | + return $this->basePath.'/'.$this->logFile; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @return string |
48 | 48 | */ |
49 | 49 | public function getSanitisedLogFilePath() { |
50 | - return $this->basePath . '/' . strtolower(FileNameFilter::create()->filter($this->logFile)); |
|
50 | + return $this->basePath.'/'.strtolower(FileNameFilter::create()->filter($this->logFile)); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | // Make sure we write into the old path for existing logs. New logs use the sanitised file path instead. |
78 | 78 | $path = file_exists($this->getRawFilePath()) ? $this->getRawFilePath() : $this->getSanitisedLogFilePath(); |
79 | 79 | |
80 | - error_log('['.date('Y-m-d H:i:s').'] ' . $message .PHP_EOL, 3, $path); |
|
80 | + error_log('['.date('Y-m-d H:i:s').'] '.$message.PHP_EOL, 3, $path); |
|
81 | 81 | @chmod($path, 0666); |
82 | 82 | } |
83 | 83 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | // Hack: loadIntoFile assumes paths relative to assets, |
37 | 37 | // otherwise it creates the whole structure *within* that folder |
38 | 38 | $absolutePath = $dataArchive->generateFilepath($dataTransfer); |
39 | - $relativePath = preg_replace('#^' . preg_quote(ASSETS_PATH) . '/#', '', $absolutePath); |
|
39 | + $relativePath = preg_replace('#^'.preg_quote(ASSETS_PATH).'/#', '', $absolutePath); |
|
40 | 40 | $this->upload->loadIntoFile($_FILES[$this->name], $file, $relativePath); |
41 | 41 | if($this->upload->isError()) { |
42 | 42 | return false; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $file = $this->upload->getFile(); |
46 | 46 | if($this->relationAutoSetting) { |
47 | 47 | // save to record |
48 | - $record->{$this->name . 'ID'} = $file->ID; |
|
48 | + $record->{$this->name.'ID'} = $file->ID; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | return $this; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | protected function getJobs() { |
50 | 50 | $jobs = new ArrayList(); |
51 | 51 | |
52 | - $resqueJobs = Resque::redis()->lrange('queue:' . $this->Name, 0, -1); |
|
52 | + $resqueJobs = Resque::redis()->lrange('queue:'.$this->Name, 0, -1); |
|
53 | 53 | if(!$resqueJobs) { |
54 | 54 | $jobs->push(new ResqueJob(array( |
55 | 55 | 'Name' => 'null', |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | $stdClass = json_decode($job); |
62 | 62 | if($stdClass->class === 'CapistranoDeploy' || $stdClass->class === 'DeployJob') { |
63 | 63 | $value = $stdClass->args[0]->projectName |
64 | - . ':' . $stdClass->args[0]->environment |
|
65 | - . ' - ' . $stdClass->args[0]->sha; |
|
64 | + . ':'.$stdClass->args[0]->environment |
|
65 | + . ' - '.$stdClass->args[0]->sha; |
|
66 | 66 | $jobs->push(new ResqueJob(array( |
67 | 67 | 'Name' => $stdClass->class, |
68 | 68 | 'Value' => $value, |
@@ -51,12 +51,12 @@ |
||
51 | 51 | public function getPackageFilename($identifier, $sha, $repositoryDir, DeploynautLogFile $log) { |
52 | 52 | // Fetch through the cache |
53 | 53 | if($this->cache) { |
54 | - $identifier .= '-' . get_class($this) . '-' . $this->getIdentifier(); |
|
54 | + $identifier .= '-'.get_class($this).'-'.$this->getIdentifier(); |
|
55 | 55 | return $this->cache->getPackageFilename($this, $identifier, $sha, $repositoryDir, $log); |
56 | 56 | |
57 | 57 | // Default, cacheless implementation |
58 | 58 | } else { |
59 | - $filename = TEMP_FOLDER . '/' . $sha . '.tar.gz'; |
|
59 | + $filename = TEMP_FOLDER.'/'.$sha.'.tar.gz'; |
|
60 | 60 | if($this->generatePackage($sha, $repositoryDir, $filename, $log)) { |
61 | 61 | return $filename; |
62 | 62 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | |
42 | 42 | $file = sprintf('%s/%s.deploy-history.txt', DEPLOYNAUT_LOG_PATH, $environment->getFullName()); |
43 | 43 | $CLI_file = escapeshellarg($file); |
44 | - $CLI_line = escapeshellarg(date('Y-m-d H:i:s') . " => $sha"); |
|
44 | + $CLI_line = escapeshellarg(date('Y-m-d H:i:s')." => $sha"); |
|
45 | 45 | |
46 | 46 | // Put maintenance page up |
47 | 47 | $this->enableMaintenance($environment, $log, $project); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | throw new \LogicException("Can't use PackageCache without setting BaseDir"); |
53 | 53 | } |
54 | 54 | |
55 | - $buildPath = $this->baseDir . '/' . $this->sanitiseDirName($identifier); |
|
55 | + $buildPath = $this->baseDir.'/'.$this->sanitiseDirName($identifier); |
|
56 | 56 | $filename = "$buildPath/$sha.tar.gz"; |
57 | 57 | |
58 | 58 | if(!file_exists($this->baseDir)) { |
@@ -103,14 +103,14 @@ discard block |
||
103 | 103 | * @param DeploynautLogFile $log The log to send removal status messages to |
104 | 104 | */ |
105 | 105 | protected function reduceDirSizeTo($dir, $count, DeploynautLogFile $log) { |
106 | - $files = glob($dir . '/*.tar.gz'); |
|
106 | + $files = glob($dir.'/*.tar.gz'); |
|
107 | 107 | if(sizeof($files) > $count) { |
108 | 108 | usort($files, function($a, $b) { |
109 | 109 | return filemtime($a) > filemtime($b); |
110 | 110 | }); |
111 | 111 | |
112 | 112 | for($i = 0; $i < sizeof($files) - $count; $i++) { |
113 | - $log->write("Removing " . $files[$i] . " from package cache"); |
|
113 | + $log->write("Removing ".$files[$i]." from package cache"); |
|
114 | 114 | unlink($files[$i]); |
115 | 115 | } |
116 | 116 | } |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | |
20 | 20 | if($dryRun) { |
21 | 21 | echo "Running in dry run mode, no changes commited, "; |
22 | - echo "the output shows a prediction on what will happen." . PHP_EOL; |
|
23 | - echo "To skip dryrun, run the task like this:" . PHP_EOL; |
|
24 | - echo "./framework/sake dev/tasks/SyncProjectsAndEnvironments dryrun=0" . PHP_EOL . PHP_EOL; |
|
22 | + echo "the output shows a prediction on what will happen.".PHP_EOL; |
|
23 | + echo "To skip dryrun, run the task like this:".PHP_EOL; |
|
24 | + echo "./framework/sake dev/tasks/SyncProjectsAndEnvironments dryrun=0".PHP_EOL.PHP_EOL; |
|
25 | 25 | sleep(3); |
26 | 26 | } |
27 | 27 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | foreach($removeList as $remove) { |
70 | - $this->message('Removing "' . basename($remove->Name) . '" from db'); |
|
70 | + $this->message('Removing "'.basename($remove->Name).'" from db'); |
|
71 | 71 | if(!$dryRun) { |
72 | 72 | $removeList->remove($remove); |
73 | 73 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | foreach($removeList as $remove) { |
91 | - $this->message($remove->Name . ' ' . $remove->Path); |
|
91 | + $this->message($remove->Name.' '.$remove->Path); |
|
92 | 92 | if(!$dryrun) { |
93 | 93 | $removeList->remove($remove); |
94 | 94 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | continue; |
121 | 121 | } |
122 | 122 | |
123 | - $this->message('Adding "' . basename($path) . '" to db'); |
|
123 | + $this->message('Adding "'.basename($path).'" to db'); |
|
124 | 124 | if(!$dryRun) { |
125 | 125 | $environment = DNEnvironment::create_from_path($path); |
126 | 126 | $environment->ProjectID = $project->ID; |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | */ |
152 | 152 | protected function message($text) { |
153 | 153 | if(PHP_SAPI !== 'cli') { |
154 | - $text = '<p>' . $text . '</p>' . PHP_EOL; |
|
154 | + $text = '<p>'.$text.'</p>'.PHP_EOL; |
|
155 | 155 | } |
156 | - echo ' - ' . $text . PHP_EOL; |
|
156 | + echo ' - '.$text.PHP_EOL; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
@@ -161,9 +161,9 @@ discard block |
||
161 | 161 | */ |
162 | 162 | protected function echoHeader($text) { |
163 | 163 | if(PHP_SAPI !== 'cli') { |
164 | - echo '<h2>' . $text . '</h2>' . PHP_EOL; |
|
164 | + echo '<h2>'.$text.'</h2>'.PHP_EOL; |
|
165 | 165 | } else { |
166 | - echo '# ' . $text . PHP_EOL; |
|
166 | + echo '# '.$text.PHP_EOL; |
|
167 | 167 | } |
168 | 168 | } |
169 | 169 | } |