Completed
Push — master ( f5fbc6...1a80da )
by Stig
08:58 queued 04:38
created
code/backends/CapistranoDeploymentBackend.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 		$currentBuild = $environment->CurrentBuild();
27 27
 		$currentSha = $currentBuild ? $currentBuild->SHA : '-';
28
-		if($currentSha !== $options['sha']) {
28
+		if ($currentSha !== $options['sha']) {
29 29
 			$strategy->setChange('Code version', $currentSha, $options['sha']);
30 30
 		}
31 31
 		$strategy->setActionTitle('Confirm deployment');
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
 		// Use a package generator if specified, otherwise run a direct deploy, which is the default behaviour
68 68
 		// if build_filename isn't specified
69
-		if($this->packageGenerator) {
69
+		if ($this->packageGenerator) {
70 70
 			$log->write(sprintf('Using package generator "%s"', get_class($this->packageGenerator)));
71 71
 
72 72
 			try {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 				throw $e;
77 77
 			}
78 78
 
79
-			if(empty($args['build_filename'])) {
79
+			if (empty($args['build_filename'])) {
80 80
 				throw new RuntimeException('Failed to generate package.');
81 81
 			}
82 82
 		}
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 				$log->write($buffer);
95 95
 			});
96 96
 
97
-			if(!$command->isSuccessful()) {
97
+			if (!$command->isSuccessful()) {
98 98
 				$self->extend('cleanupFailure', $environment, $sha, $log, $project);
99 99
 				$log->write('Warning: Cleanup failed, but fine to continue. Needs manual cleanup sometime.');
100 100
 			}
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 		$this->enableMaintenance($environment, $log, $project);
106 106
 
107 107
 		$rolledBack = null;
108
-		if(!$command->isSuccessful() || !$this->smokeTest($environment, $log)) {
108
+		if (!$command->isSuccessful() || !$this->smokeTest($environment, $log)) {
109 109
 			$cleanupFn();
110 110
 			$this->extend('deployFailure', $environment, $sha, $log, $project);
111 111
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		$command->run(function($type, $buffer) use($log) {
172 172
 			$log->write($buffer);
173 173
 		});
174
-		if(!$command->isSuccessful()) {
174
+		if (!$command->isSuccessful()) {
175 175
 			$this->extend('maintenanceEnableFailure', $environment, $log);
176 176
 			throw new RuntimeException($command->getErrorOutput());
177 177
 		}
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		$command->run(function($type, $buffer) use($log) {
188 188
 			$log->write($buffer);
189 189
 		});
190
-		if(!$command->isSuccessful()) {
190
+		if (!$command->isSuccessful()) {
191 191
 			$this->extend('maintenanceDisableFailure', $environment, $log);
192 192
 			throw new RuntimeException($command->getErrorOutput());
193 193
 		}
@@ -209,25 +209,25 @@  discard block
 block discarded – undo
209 209
 	 * @inheritdoc
210 210
 	 */
211 211
 	public function dataTransfer(DNDataTransfer $dataTransfer, DeploynautLogFile $log) {
212
-		if($dataTransfer->Direction == 'get') {
212
+		if ($dataTransfer->Direction == 'get') {
213 213
 			$this->dataTransferBackup($dataTransfer, $log);
214 214
 		} else {
215 215
 			$environment = $dataTransfer->Environment();
216 216
 			$project = $environment->Project();
217
-			$workingDir = TEMP_FOLDER . DIRECTORY_SEPARATOR . 'deploynaut-transfer-' . $dataTransfer->ID;
217
+			$workingDir = TEMP_FOLDER.DIRECTORY_SEPARATOR.'deploynaut-transfer-'.$dataTransfer->ID;
218 218
 			$archive = $dataTransfer->DataArchive();
219 219
 
220 220
 			// extract the sspak contents, we'll need these so capistrano can restore that content
221 221
 			try {
222 222
 				$archive->extractArchive($workingDir);
223
-			} catch(Exception $e) {
223
+			} catch (Exception $e) {
224 224
 				$log->write($e->getMessage());
225 225
 				throw new RuntimeException($e->getMessage());
226 226
 			}
227 227
 
228 228
 			// validate the contents match the requested transfer mode
229 229
 			$result = $archive->validateArchiveContents($dataTransfer->Mode);
230
-			if(!$result->valid()) {
230
+			if (!$result->valid()) {
231 231
 				// do some cleaning, get rid of the extracted archive lying around
232 232
 				$process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir)));
233 233
 				$process->setTimeout(120);
@@ -257,41 +257,41 @@  discard block
 block discarded – undo
257 257
 		$name = $environment->getFullName();
258 258
 		$env = $environment->Project()->getProcessEnv();
259 259
 
260
-		if(!$args) {
260
+		if (!$args) {
261 261
 			$args = array();
262 262
 		}
263
-		$args['history_path'] = realpath(DEPLOYNAUT_LOG_PATH . '/');
263
+		$args['history_path'] = realpath(DEPLOYNAUT_LOG_PATH.'/');
264 264
 		$args['environment_id'] = $environment->ID;
265 265
 
266 266
 		// Inject env string directly into the command.
267 267
 		// Capistrano doesn't like the $process->setEnv($env) we'd normally do below.
268 268
 		$envString = '';
269
-		if(!empty($env)) {
269
+		if (!empty($env)) {
270 270
 			$envString .= 'env ';
271
-			foreach($env as $key => $value) {
271
+			foreach ($env as $key => $value) {
272 272
 				$envString .= "$key=\"$value\" ";
273 273
 			}
274 274
 		}
275 275
 
276 276
 		$data = DNData::inst();
277 277
 		// Generate a capfile from a template
278
-		$capTemplate = file_get_contents(BASE_PATH . '/deploynaut/Capfile.template');
278
+		$capTemplate = file_get_contents(BASE_PATH.'/deploynaut/Capfile.template');
279 279
 		$cap = str_replace(
280 280
 			array('<config root>', '<ssh key>', '<base path>'),
281 281
 			array($data->getEnvironmentDir(), DEPLOYNAUT_SSH_KEY, BASE_PATH),
282 282
 			$capTemplate
283 283
 		);
284 284
 
285
-		if(defined('DEPLOYNAUT_CAPFILE')) {
285
+		if (defined('DEPLOYNAUT_CAPFILE')) {
286 286
 			$capFile = DEPLOYNAUT_CAPFILE;
287 287
 		} else {
288
-			$capFile = ASSETS_PATH . '/Capfile';
288
+			$capFile = ASSETS_PATH.'/Capfile';
289 289
 		}
290 290
 		file_put_contents($capFile, $cap);
291 291
 
292
-		$command = "{$envString}cap -f " . escapeshellarg($capFile) . " -vv $name $action ROLES=$roles";
293
-		foreach($args as $argName => $argVal) {
294
-			$command .= ' -s ' . escapeshellarg($argName) . '=' . escapeshellarg($argVal);
292
+		$command = "{$envString}cap -f ".escapeshellarg($capFile)." -vv $name $action ROLES=$roles";
293
+		foreach ($args as $argName => $argVal) {
294
+			$command .= ' -s '.escapeshellarg($argName).'='.escapeshellarg($argVal);
295 295
 		}
296 296
 
297 297
 		$log->write(sprintf('Running command: %s', $command));
@@ -325,16 +325,16 @@  discard block
 block discarded – undo
325 325
 		$filepathBase = $dataArchive->generateFilepath($dataTransfer);
326 326
 		mkdir($filepathBase, 0700, true);
327 327
 
328
-		$databasePath = $filepathBase . DIRECTORY_SEPARATOR . 'database.sql.gz';
328
+		$databasePath = $filepathBase.DIRECTORY_SEPARATOR.'database.sql.gz';
329 329
 
330 330
 		// Backup database
331
-		if(in_array($dataTransfer->Mode, array('all', 'db'))) {
331
+		if (in_array($dataTransfer->Mode, array('all', 'db'))) {
332 332
 			$log->write(sprintf('Backup of database from "%s" started', $name));
333 333
 			$command = $this->getCommand('data:getdb', 'db', $environment, array('data_path' => $databasePath), $log);
334 334
 			$command->run(function($type, $buffer) use($log) {
335 335
 				$log->write($buffer);
336 336
 			});
337
-			if(!$command->isSuccessful()) {
337
+			if (!$command->isSuccessful()) {
338 338
 				$this->extend('dataTransferFailure', $environment, $log);
339 339
 				throw new RuntimeException($command->getErrorOutput());
340 340
 			}
@@ -342,13 +342,13 @@  discard block
 block discarded – undo
342 342
 		}
343 343
 
344 344
 		// Backup assets
345
-		if(in_array($dataTransfer->Mode, array('all', 'assets'))) {
345
+		if (in_array($dataTransfer->Mode, array('all', 'assets'))) {
346 346
 			$log->write(sprintf('Backup of assets from "%s" started', $name));
347 347
 			$command = $this->getCommand('data:getassets', 'web', $environment, array('data_path' => $filepathBase), $log);
348 348
 			$command->run(function($type, $buffer) use($log) {
349 349
 				$log->write($buffer);
350 350
 			});
351
-			if(!$command->isSuccessful()) {
351
+			if (!$command->isSuccessful()) {
352 352
 				$this->extend('dataTransferFailure', $environment, $log);
353 353
 				throw new RuntimeException($command->getErrorOutput());
354 354
 			}
@@ -363,12 +363,12 @@  discard block
 block discarded – undo
363 363
 		$log->write('Creating sspak...');
364 364
 
365 365
 		$sspakFilename = sprintf('%s.sspak', $dataArchive->generateFilename($dataTransfer));
366
-		$sspakFilepath = $filepathBase . DIRECTORY_SEPARATOR . $sspakFilename;
366
+		$sspakFilepath = $filepathBase.DIRECTORY_SEPARATOR.$sspakFilename;
367 367
 
368 368
 		try {
369 369
 			$dataArchive->attachFile($sspakFilepath, $dataTransfer);
370 370
 			$dataArchive->setArchiveFromFiles($filepathBase);
371
-		} catch(Exception $e) {
371
+		} catch (Exception $e) {
372 372
 			$log->write($e->getMessage());
373 373
 			throw new RuntimeException($e->getMessage());
374 374
 		}
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 		$process = new AbortableProcess(sprintf('rm -rf %s/assets && rm -f %s', escapeshellarg($filepathBase), escapeshellarg($databasePath)));
380 380
 		$process->setTimeout(120);
381 381
 		$process->run();
382
-		if(!$process->isSuccessful()) {
382
+		if (!$process->isSuccessful()) {
383 383
 			$log->write('Could not delete temporary files');
384 384
 			throw new RuntimeException($process->getErrorOutput());
385 385
 		}
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 		$command->run(function($type, $buffer) use($log) {
399 399
 			$log->write($buffer);
400 400
 		});
401
-		if(!$command->isSuccessful()) {
401
+		if (!$command->isSuccessful()) {
402 402
 			$log->write(sprintf('Rebuild of "%s" failed: %s', $name, $command->getErrorOutput()));
403 403
 			throw new RuntimeException($command->getErrorOutput());
404 404
 		}
@@ -428,14 +428,14 @@  discard block
 block discarded – undo
428 428
 		};
429 429
 
430 430
 		// Restore database into target environment
431
-		if(in_array($dataTransfer->Mode, array('all', 'db'))) {
431
+		if (in_array($dataTransfer->Mode, array('all', 'db'))) {
432 432
 			$log->write(sprintf('Restore of database to "%s" started', $name));
433
-			$args = array('data_path' => $workingDir . DIRECTORY_SEPARATOR . 'database.sql');
433
+			$args = array('data_path' => $workingDir.DIRECTORY_SEPARATOR.'database.sql');
434 434
 			$command = $this->getCommand('data:pushdb', 'db', $environment, $args, $log);
435 435
 			$command->run(function($type, $buffer) use($log) {
436 436
 				$log->write($buffer);
437 437
 			});
438
-			if(!$command->isSuccessful()) {
438
+			if (!$command->isSuccessful()) {
439 439
 				$cleanupFn();
440 440
 				$log->write(sprintf('Restore of database to "%s" failed: %s', $name, $command->getErrorOutput()));
441 441
 				$this->extend('dataTransferFailure', $environment, $log);
@@ -445,14 +445,14 @@  discard block
 block discarded – undo
445 445
 		}
446 446
 
447 447
 		// Restore assets into target environment
448
-		if(in_array($dataTransfer->Mode, array('all', 'assets'))) {
448
+		if (in_array($dataTransfer->Mode, array('all', 'assets'))) {
449 449
 			$log->write(sprintf('Restore of assets to "%s" started', $name));
450
-			$args = array('data_path' => $workingDir . DIRECTORY_SEPARATOR . 'assets');
450
+			$args = array('data_path' => $workingDir.DIRECTORY_SEPARATOR.'assets');
451 451
 			$command = $this->getCommand('data:pushassets', 'web', $environment, $args, $log);
452 452
 			$command->run(function($type, $buffer) use($log) {
453 453
 				$log->write($buffer);
454 454
 			});
455
-			if(!$command->isSuccessful()) {
455
+			if (!$command->isSuccessful()) {
456 456
 				$cleanupFn();
457 457
 				$log->write(sprintf('Restore of assets to "%s" failed: %s', $name, $command->getErrorOutput()));
458 458
 				$this->extend('dataTransferFailure', $environment, $log);
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 		$timeout = 600;
478 478
 		$tick = 60;
479 479
 
480
-		if(!$url) {
480
+		if (!$url) {
481 481
 			$log->write('Skipping site accessible check: no URL found.');
482 482
 			return true;
483 483
 		}
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 		// query the site every second. Note that if the URL doesn't respond,
509 509
 		// curl_exec will take 5 seconds to timeout (see CURLOPT_CONNECTTIMEOUT and CURLOPT_TIMEOUT above)
510 510
 		do {
511
-			if(time() > $start + $timeout) {
511
+			if (time() > $start + $timeout) {
512 512
 				$log->write(sprintf(' * Failed: check for %s timed out after %smin', $url, $timeout / 60));
513 513
 				return false;
514 514
 			}
@@ -517,13 +517,13 @@  discard block
 block discarded – undo
517 517
 
518 518
 			// check the HTTP response code for HTTP protocols
519 519
 			$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
520
-			if($status && !in_array($status, [500, 501, 502, 503, 504])) {
520
+			if ($status && !in_array($status, [500, 501, 502, 503, 504])) {
521 521
 				$success = true;
522 522
 			}
523 523
 
524 524
 			// check for any curl errors, mostly for checking the response state of non-HTTP protocols,
525 525
 			// but applies to checks of any protocol
526
-			if($response && !curl_errno($ch)) {
526
+			if ($response && !curl_errno($ch)) {
527 527
 				$success = true;
528 528
 			}
529 529
 
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 			}
552 552
 
553 553
 			sleep(1);
554
-		} while(!$success);
554
+		} while (!$success);
555 555
 
556 556
 		curl_close($ch);
557 557
 		$log->write(' * Success: site is accessible!');
Please login to merge, or discard this patch.
code/jobs/CreateEnvJob.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,27 +19,27 @@
 block discarded – undo
19 19
 	 *
20 20
 	 */
21 21
 	public function perform() {
22
-		echo "[-] CreateEnvJob starting" . PHP_EOL;
22
+		echo "[-] CreateEnvJob starting".PHP_EOL;
23 23
 
24 24
 		$log = new DeploynautLogFile($this->args['logfile']);
25 25
 		$envCreate = DNCreateEnvironment::get()->byId($this->args['createID']);
26 26
 
27 27
 		// This is a bit icky, but there is no easy way of capturing a failed deploy by using the PHP Resque
28 28
 		try {
29
-			if(!($envCreate && $envCreate->exists())) {
29
+			if (!($envCreate && $envCreate->exists())) {
30 30
 				throw new RuntimeException(sprintf('Could not find create environment record %s', $args['createID']));
31 31
 			}
32 32
 
33 33
 			// This will throw and exception if it fails.
34 34
 			$envCreate->createEnvironment();
35 35
 
36
-		} catch(Exception $e) {
36
+		} catch (Exception $e) {
37 37
 			$log->write($e->getMessage());
38
-			echo "[-] CreateEnvJob failed" . PHP_EOL;
38
+			echo "[-] CreateEnvJob failed".PHP_EOL;
39 39
 			throw $e;
40 40
 		}
41 41
 		$this->updateStatus('Finished');
42
-		echo "[-] CreateEnvJob finished" . PHP_EOL;
42
+		echo "[-] CreateEnvJob finished".PHP_EOL;
43 43
 	}
44 44
 
45 45
 	/**
Please login to merge, or discard this patch.
code/control/DNRoot.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 		Requirements::javascript('deploynaut/javascript/material.js');
180 180
 
181 181
 		// Load the buildable dependencies only if not loaded centrally.
182
-		if (!is_dir(BASE_PATH . DIRECTORY_SEPARATOR . 'static')) {
182
+		if (!is_dir(BASE_PATH.DIRECTORY_SEPARATOR.'static')) {
183 183
 			if (\Director::isDev()) {
184 184
 				\Requirements::javascript('deploynaut/static/bundle-debug.js');
185 185
 			} else {
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 		}
244 244
 
245 245
 		// Block framework jquery
246
-		Requirements::block(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
246
+		Requirements::block(FRAMEWORK_DIR.'/thirdparty/jquery/jquery.js');
247 247
 
248 248
 		self::include_requirements();
249 249
 	}
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 	 * @return \SS_HTTPResponse
263 263
 	 */
264 264
 	public function index(SS_HTTPRequest $request) {
265
-		return $this->redirect($this->Link() . 'projects/');
265
+		return $this->redirect($this->Link().'projects/');
266 266
 	}
267 267
 
268 268
 	/**
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 		// Framing an environment as a "group of people with download access"
391 391
 		// makes more sense to the user here, while still allowing us to enforce
392 392
 		// environment specific restrictions on downloading the file later on.
393
-		$envs = $project->DNEnvironmentList()->filterByCallback(function ($item) {
393
+		$envs = $project->DNEnvironmentList()->filterByCallback(function($item) {
394 394
 			return $item->canUploadArchive();
395 395
 		});
396 396
 		$envsMap = [];
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 		$form->disableSecurityToken();
423 423
 		$form->addExtraClass('fields-wide');
424 424
 		// Tweak the action so it plays well with our fake URL structure.
425
-		$form->setFormAction($project->Link() . '/UploadSnapshotForm');
425
+		$form->setFormAction($project->Link().'/UploadSnapshotForm');
426 426
 
427 427
 		return $form;
428 428
 	}
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 		}
444 444
 
445 445
 		$validEnvs = $project->DNEnvironmentList()
446
-			->filterByCallback(function ($item) {
446
+			->filterByCallback(function($item) {
447 447
 				return $item->canUploadArchive();
448 448
 			});
449 449
 
@@ -472,9 +472,9 @@  discard block
 block discarded – undo
472 472
 		$dataArchive->DataTransfers()->add($dataTransfer);
473 473
 		$form->saveInto($dataArchive);
474 474
 		$dataArchive->write();
475
-		$workingDir = TEMP_FOLDER . DIRECTORY_SEPARATOR . 'deploynaut-transfer-' . $dataTransfer->ID;
475
+		$workingDir = TEMP_FOLDER.DIRECTORY_SEPARATOR.'deploynaut-transfer-'.$dataTransfer->ID;
476 476
 
477
-		$cleanupFn = function () use ($workingDir, $dataTransfer, $dataArchive) {
477
+		$cleanupFn = function() use ($workingDir, $dataTransfer, $dataArchive) {
478 478
 			$process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir)));
479 479
 			$process->setTimeout(120);
480 480
 			$process->run();
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 		// Framing an environment as a "group of people with download access"
549 549
 		// makes more sense to the user here, while still allowing us to enforce
550 550
 		// environment specific restrictions on downloading the file later on.
551
-		$envs = $project->DNEnvironmentList()->filterByCallback(function ($item) {
551
+		$envs = $project->DNEnvironmentList()->filterByCallback(function($item) {
552 552
 			return $item->canUploadArchive();
553 553
 		});
554 554
 		$envsMap = [];
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 		$form->disableSecurityToken();
575 575
 		$form->addExtraClass('fields-wide');
576 576
 		// Tweak the action so it plays well with our fake URL structure.
577
-		$form->setFormAction($project->Link() . '/PostSnapshotForm');
577
+		$form->setFormAction($project->Link().'/PostSnapshotForm');
578 578
 
579 579
 		return $form;
580 580
 	}
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 			return $this->project404Response();
594 594
 		}
595 595
 
596
-		$validEnvs = $project->DNEnvironmentList()->filterByCallback(function ($item) {
596
+		$validEnvs = $project->DNEnvironmentList()->filterByCallback(function($item) {
597 597
 			return $item->canUploadArchive();
598 598
 		});
599 599
 
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
 		$branchName = $request->getVar('name');
714 714
 		$branch = $project->DNBranchList()->byName($branchName);
715 715
 		if (!$branch) {
716
-			return new SS_HTTPResponse("Branch '" . Convert::raw2xml($branchName) . "' not found.", 404);
716
+			return new SS_HTTPResponse("Branch '".Convert::raw2xml($branchName)."' not found.", 404);
717 717
 		}
718 718
 
719 719
 		return $this->render([
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
 		);
851 851
 
852 852
 		// Tweak the action so it plays well with our fake URL structure.
853
-		$form->setFormAction($project->Link() . '/CreateEnvironmentForm');
853
+		$form->setFormAction($project->Link().'/CreateEnvironmentForm');
854 854
 
855 855
 		return $form;
856 856
 	}
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
 		$job->write();
884 884
 		$job->start();
885 885
 
886
-		return $this->redirect($project->Link('createenv') . '/' . $job->ID);
886
+		return $this->redirect($project->Link('createenv').'/'.$job->ID);
887 887
 	}
888 888
 
889 889
 	/**
@@ -1081,7 +1081,7 @@  discard block
 block discarded – undo
1081 1081
 			return $body;
1082 1082
 		}
1083 1083
 
1084
-		$form->setFormAction($this->getRequest()->getURL() . '/DeployForm');
1084
+		$form->setFormAction($this->getRequest()->getURL().'/DeployForm');
1085 1085
 		return $form;
1086 1086
 	}
1087 1087
 
@@ -1347,7 +1347,7 @@  discard block
 block discarded – undo
1347 1347
 		$deployment->getMachine()->apply(DNDeployment::TR_QUEUE);
1348 1348
 
1349 1349
 		return json_encode([
1350
-			'url' => Director::absoluteBaseURL() . $deployment->Link()
1350
+			'url' => Director::absoluteBaseURL().$deployment->Link()
1351 1351
 		], JSON_PRETTY_PRINT);
1352 1352
 	}
1353 1353
 
@@ -1470,7 +1470,7 @@  discard block
 block discarded – undo
1470 1470
 	 */
1471 1471
 	public function getDataTransferForm(SS_HTTPRequest $request = null) {
1472 1472
 		// Performs canView permission check by limiting visible projects
1473
-		$envs = $this->getCurrentProject()->DNEnvironmentList()->filterByCallback(function ($item) {
1473
+		$envs = $this->getCurrentProject()->DNEnvironmentList()->filterByCallback(function($item) {
1474 1474
 			return $item->canBackup();
1475 1475
 		});
1476 1476
 
@@ -1480,7 +1480,7 @@  discard block
 block discarded – undo
1480 1480
 
1481 1481
 		$items = [];
1482 1482
 		$disabledEnvironments = [];
1483
-		foreach($envs as $env) {
1483
+		foreach ($envs as $env) {
1484 1484
 			$items[$env->ID] = $env->Title;
1485 1485
 			if ($env->CurrentBuild() === false) {
1486 1486
 				$items[$env->ID] = sprintf("%s - requires initial deployment", $env->Title);
@@ -1488,7 +1488,7 @@  discard block
 block discarded – undo
1488 1488
 			}
1489 1489
 		}
1490 1490
 
1491
-		$envsField =  DropdownField::create('EnvironmentID', 'Environment', $items)
1491
+		$envsField = DropdownField::create('EnvironmentID', 'Environment', $items)
1492 1492
 			->setEmptyString('Select an environment');
1493 1493
 		$envsField->setDisabledItems($disabledEnvironments);
1494 1494
 
@@ -1509,7 +1509,7 @@  discard block
 block discarded – undo
1509 1509
 			),
1510 1510
 			FieldList::create($formAction)
1511 1511
 		);
1512
-		$form->setFormAction($this->getRequest()->getURL() . '/DataTransferForm');
1512
+		$form->setFormAction($this->getRequest()->getURL().'/DataTransferForm');
1513 1513
 
1514 1514
 		return $form;
1515 1515
 	}
@@ -1535,12 +1535,12 @@  discard block
 block discarded – undo
1535 1535
 		// Validate direction.
1536 1536
 		if ($data['Direction'] == 'get') {
1537 1537
 			$validEnvs = $this->getCurrentProject()->DNEnvironmentList()
1538
-				->filterByCallback(function ($item) {
1538
+				->filterByCallback(function($item) {
1539 1539
 					return $item->canBackup();
1540 1540
 				});
1541 1541
 		} else if ($data['Direction'] == 'push') {
1542 1542
 			$validEnvs = $this->getCurrentProject()->DNEnvironmentList()
1543
-				->filterByCallback(function ($item) {
1543
+				->filterByCallback(function($item) {
1544 1544
 					return $item->canRestore();
1545 1545
 				});
1546 1546
 		} else {
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
 
1672 1672
 		// Performs canView permission check by limiting visible projects
1673 1673
 		$project = $this->getCurrentProject();
1674
-		$envs = $project->DNEnvironmentList()->filterByCallback(function ($item) {
1674
+		$envs = $project->DNEnvironmentList()->filterByCallback(function($item) {
1675 1675
 			return $item->canRestore();
1676 1676
 		});
1677 1677
 
@@ -1696,7 +1696,7 @@  discard block
 block discarded – undo
1696 1696
 
1697 1697
 		$items = [];
1698 1698
 		$disabledEnvironments = [];
1699
-		foreach($envs as $env) {
1699
+		foreach ($envs as $env) {
1700 1700
 			$items[$env->ID] = $env->Title;
1701 1701
 			if ($env->CurrentBuild() === false) {
1702 1702
 				$items[$env->ID] = sprintf("%s - requires initial deployment", $env->Title);
@@ -1725,7 +1725,7 @@  discard block
 block discarded – undo
1725 1725
 			),
1726 1726
 			FieldList::create($formAction)
1727 1727
 		);
1728
-		$form->setFormAction($project->Link() . '/DataTransferRestoreForm');
1728
+		$form->setFormAction($project->Link().'/DataTransferRestoreForm');
1729 1729
 
1730 1730
 		return $form;
1731 1731
 	}
@@ -1823,7 +1823,7 @@  discard block
 block discarded – undo
1823 1823
 					->addExtraClass('btn')
1824 1824
 			)
1825 1825
 		);
1826
-		$form->setFormAction($project->Link() . '/DeleteForm');
1826
+		$form->setFormAction($project->Link().'/DeleteForm');
1827 1827
 
1828 1828
 		return $form;
1829 1829
 	}
@@ -1929,7 +1929,7 @@  discard block
 block discarded – undo
1929 1929
 					->addExtraClass('btn')
1930 1930
 			)
1931 1931
 		);
1932
-		$form->setFormAction($this->getCurrentProject()->Link() . '/MoveForm');
1932
+		$form->setFormAction($this->getCurrentProject()->Link().'/MoveForm');
1933 1933
 
1934 1934
 		return $form;
1935 1935
 	}
@@ -2190,7 +2190,7 @@  discard block
 block discarded – undo
2190 2190
 		$transfers = DNDataTransfer::get()
2191 2191
 			->filter('EnvironmentID', $environments)
2192 2192
 			->filterByCallback(
2193
-				function ($record) {
2193
+				function($record) {
2194 2194
 					return
2195 2195
 						$record->Environment()->canRestore() || // Ensure member can perform an action on the transfers env
2196 2196
 						$record->Environment()->canBackup() ||
@@ -2315,7 +2315,7 @@  discard block
 block discarded – undo
2315 2315
 	 */
2316 2316
 	protected function project404Response() {
2317 2317
 		return new SS_HTTPResponse(
2318
-			"Project '" . Convert::raw2xml($this->getRequest()->param('Project')) . "' not found.",
2318
+			"Project '".Convert::raw2xml($this->getRequest()->param('Project'))."' not found.",
2319 2319
 			404
2320 2320
 		);
2321 2321
 	}
@@ -2325,7 +2325,7 @@  discard block
 block discarded – undo
2325 2325
 	 */
2326 2326
 	protected function environment404Response() {
2327 2327
 		$envName = Convert::raw2xml($this->getRequest()->param('Environment'));
2328
-		return new SS_HTTPResponse("Environment '" . $envName . "' not found.", 404);
2328
+		return new SS_HTTPResponse("Environment '".$envName."' not found.", 404);
2329 2329
 	}
2330 2330
 
2331 2331
 	/**
Please login to merge, or discard this patch.
code/api/DeploynautAPIFormatter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 		// failover for older deployments
42 42
 		$started = $deployment->Created;
43 43
 		$startedNice = $deployment->obj('Created')->Nice();
44
-		if($deployment->DeployStarted) {
44
+		if ($deployment->DeployStarted) {
45 45
 			$started = $deployment->DeployStarted;
46 46
 			$startedNice = $deployment->obj('DeployStarted')->Nice();
47 47
 		}
Please login to merge, or discard this patch.
code/SS_Datetimezone.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 	* Returns the date in the raw SQL-format specific to a given timezone passed from the Member class, e.g. “2006-01-18 16:32:04”
10 10
 	*/
11 11
 	public function Format($format) {
12
-		if($this->value){
12
+		if ($this->value) {
13 13
 			$date = new DateTime($this->value);
14 14
 			//if the current user has set a timezone that is not the default then use that
15 15
 			$member = Member::currentUser();
Please login to merge, or discard this patch.
code/model/DNDataArchive.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	}
122 122
 
123 123
 	public function onBeforeWrite() {
124
-		if(!$this->AuthorID) {
124
+		if (!$this->AuthorID) {
125 125
 			$this->AuthorID = Member::currentUserID();
126 126
 		}
127 127
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 * @return string The human-readable size of this archive file
180 180
 	 */
181 181
 	public function FileSize() {
182
-		if($this->ArchiveFile()->exists()) {
182
+		if ($this->ArchiveFile()->exists()) {
183 183
 			return $this->ArchiveFile()->getSize();
184 184
 		} else {
185 185
 			return "N/A";
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	}
188 188
 
189 189
 	public function getModeNice() {
190
-		if($this->Mode == 'all') {
190
+		if ($this->Mode == 'all') {
191 191
 			return 'database and assets';
192 192
 		} else {
193 193
 			return $this->Mode;
@@ -223,12 +223,12 @@  discard block
 block discarded – undo
223 223
 	 */
224 224
 	public function canRestore($member = null) {
225 225
 		$memberID = $member ? $member->ID : Member::currentUserID();
226
-		if(!$memberID) {
226
+		if (!$memberID) {
227 227
 			return false;
228 228
 		}
229 229
 
230
-		$key = $memberID . '-' . $this->EnvironmentID;
231
-		if(!isset(self::$_cache_can_restore[$key])) {
230
+		$key = $memberID.'-'.$this->EnvironmentID;
231
+		if (!isset(self::$_cache_can_restore[$key])) {
232 232
 			self::$_cache_can_restore[$key] = $this->Environment()->canUploadArchive($member);
233 233
 		}
234 234
 
@@ -244,12 +244,12 @@  discard block
 block discarded – undo
244 244
 	 */
245 245
 	public function canDownload($member = null) {
246 246
 		$memberID = $member ? $member->ID : Member::currentUserID();
247
-		if(!$memberID) {
247
+		if (!$memberID) {
248 248
 			return false;
249 249
 		}
250 250
 
251
-		$key = $memberID . '-' . $this->EnvironmentID;
252
-		if(!isset(self::$_cache_can_download[$key])) {
251
+		$key = $memberID.'-'.$this->EnvironmentID;
252
+		if (!isset(self::$_cache_can_download[$key])) {
253 253
 			self::$_cache_can_download[$key] = $this->Environment()->canDownloadArchive($member);
254 254
 		}
255 255
 		return self::$_cache_can_download[$key];
@@ -274,27 +274,27 @@  discard block
 block discarded – undo
274 274
 	 * @return boolean true if $member can upload archives linked to this environment, false if they can't.
275 275
 	 */
276 276
 	public function canMoveTo($targetEnv, $member = null) {
277
-		if($this->Environment()->Project()->ID != $targetEnv->Project()->ID) {
277
+		if ($this->Environment()->Project()->ID != $targetEnv->Project()->ID) {
278 278
 			// We don't permit moving snapshots between projects at this stage.
279 279
 			return false;
280 280
 		}
281 281
 
282
-		if(!$member) {
282
+		if (!$member) {
283 283
 			$member = Member::currentUser();
284 284
 		}
285 285
 
286 286
 		// Must be logged in to check permissions
287
-		if(!$member) {
287
+		if (!$member) {
288 288
 			return false;
289 289
 		}
290 290
 
291 291
 		// Admin can always move.
292
-		if(Permission::checkMember($member, 'ADMIN')) {
292
+		if (Permission::checkMember($member, 'ADMIN')) {
293 293
 			return true;
294 294
 		}
295 295
 
296 296
 		// Checks if the user can actually access the archive.
297
-		if(!$this->canDownload($member)) {
297
+		if (!$this->canDownload($member)) {
298 298
 			return false;
299 299
 		}
300 300
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 	 * @return bool
404 404
 	 */
405 405
 	public function extractArchive($workingDir = null) {
406
-		if(!is_dir($workingDir)) {
406
+		if (!is_dir($workingDir)) {
407 407
 			mkdir($workingDir, 0700, true);
408 408
 		}
409 409
 
@@ -422,28 +422,28 @@  discard block
 block discarded – undo
422 422
 		));
423 423
 		$process->setTimeout(3600);
424 424
 		$process->run();
425
-		if(!$process->isSuccessful()) {
425
+		if (!$process->isSuccessful()) {
426 426
 			$cleanupFn();
427 427
 			throw new RuntimeException(sprintf('Could not extract the sspak file: %s', $process->getErrorOutput()));
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();
435
-			if(!$process->isSuccessful()) {
435
+			if (!$process->isSuccessful()) {
436 436
 				$cleanupFn();
437 437
 				throw new RuntimeException(sprintf('Could not extract the db archive: %s', $process->getErrorOutput()));
438 438
 			}
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();
446
-			if(!$process->isSuccessful()) {
446
+			if (!$process->isSuccessful()) {
447 447
 				$cleanupFn();
448 448
 				throw new RuntimeException(sprintf('Could not extract the assets archive: %s', $process->getErrorOutput()));
449 449
 			}
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 
468 468
 		$file = $this->ArchiveFile()->FullPath;
469 469
 
470
-		if(!is_readable($file)) {
470
+		if (!is_readable($file)) {
471 471
 			$result->error(sprintf('SSPak file "%s" cannot be read.', $file));
472 472
 			return $result;
473 473
 		}
@@ -475,19 +475,19 @@  discard block
 block discarded – undo
475 475
 		$process = new AbortableProcess(sprintf('tar -tf %s', escapeshellarg($file)));
476 476
 		$process->setTimeout(120);
477 477
 		$process->run();
478
-		if(!$process->isSuccessful()) {
478
+		if (!$process->isSuccessful()) {
479 479
 			throw new RuntimeException(sprintf('Could not list files in archive: %s', $process->getErrorOutput()));
480 480
 		}
481 481
 
482 482
 		$output = explode(PHP_EOL, $process->getOutput());
483 483
 		$files = array_filter($output);
484 484
 
485
-		if(in_array($mode, array('all', 'db')) && !in_array('database.sql.gz', $files)) {
485
+		if (in_array($mode, array('all', 'db')) && !in_array('database.sql.gz', $files)) {
486 486
 			$result->error('The snapshot is missing the database.');
487 487
 			return $result;
488 488
 		}
489 489
 
490
-		if(in_array($mode, array('all', 'assets')) && !in_array('assets.tar.gz', $files)) {
490
+		if (in_array($mode, array('all', 'assets')) && !in_array('assets.tar.gz', $files)) {
491 491
 			$result->error('The snapshot is missing assets.');
492 492
 			return $result;
493 493
 		}
@@ -517,11 +517,11 @@  discard block
 block discarded – undo
517 517
 			sprintf('find %s -type f -exec chmod 644 {} +', escapeshellarg($workingDir))
518 518
 		);
519 519
 
520
-		foreach($fixCmds as $cmd) {
520
+		foreach ($fixCmds as $cmd) {
521 521
 			$process = new AbortableProcess($cmd);
522 522
 			$process->setTimeout(3600);
523 523
 			$process->run();
524
-			if(!$process->isSuccessful()) {
524
+			if (!$process->isSuccessful()) {
525 525
 				throw new RuntimeException($process->getErrorOutput());
526 526
 			}
527 527
 		}
@@ -540,18 +540,18 @@  discard block
 block discarded – undo
540 540
 	 */
541 541
 	public function setArchiveFromFiles($workingDir) {
542 542
 		$commands = array();
543
-		if($this->Mode == 'db') {
544
-			if (file_exists($workingDir . '/database.sql')) {
543
+		if ($this->Mode == 'db') {
544
+			if (file_exists($workingDir.'/database.sql')) {
545 545
 				$commands[] = 'gzip database.sql';
546 546
 			}
547 547
 			$commands[] = sprintf('tar -cf %s database.sql.gz', $this->ArchiveFile()->FullPath);
548 548
 			$commands[] = 'rm -f database.sql.gz';
549
-		} elseif($this->Mode == 'assets') {
549
+		} elseif ($this->Mode == 'assets') {
550 550
 			$commands[] = 'GZIP=-1 tar --dereference -czf assets.tar.gz assets';
551 551
 			$commands[] = sprintf('tar -cf %s assets.tar.gz', $this->ArchiveFile()->FullPath);
552 552
 			$commands[] = 'rm -f assets.tar.gz';
553 553
 		} else {
554
-			if (file_exists($workingDir . '/database.sql')) {
554
+			if (file_exists($workingDir.'/database.sql')) {
555 555
 				$commands[] = 'gzip database.sql';
556 556
 			}
557 557
 			$commands[] = 'GZIP=-1 tar --dereference -czf assets.tar.gz assets';
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
 		$process = new AbortableProcess(implode(' && ', $commands), $workingDir);
563 563
 		$process->setTimeout(3600);
564 564
 		$process->run();
565
-		if(!$process->isSuccessful()) {
565
+		if (!$process->isSuccessful()) {
566 566
 			throw new RuntimeException($process->getErrorOutput());
567 567
 		}
568 568
 
Please login to merge, or discard this patch.
code/tasks/CleanupOrphanedRecordsTask.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 	public function run($request) {
6 6
 		$log = function($message) {
7
-			$message = sprintf('[%s] ', date('Y-m-d H:i:s')) . $message;
8
-			echo $message . PHP_EOL;
7
+			$message = sprintf('[%s] ', date('Y-m-d H:i:s')).$message;
8
+			echo $message.PHP_EOL;
9 9
 		};
10 10
 
11 11
 		if (!Director::is_cli()) {
Please login to merge, or discard this patch.
code/model/jobs/DNDeployment.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	}
112 112
 
113 113
 	public function LogLink() {
114
-		return $this->Link() . '/log';
114
+		return $this->Link().'/log';
115 115
 	}
116 116
 
117 117
 	public function canView($member = null) {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @return \Gitonomy\Git\Repository|null
158 158
 	 */
159 159
 	public function getRepository() {
160
-		if(!$this->SHA) {
160
+		if (!$this->SHA) {
161 161
 			return null;
162 162
 		}
163 163
 		return $this->Environment()->Project()->getRepository();
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
 	 */
171 171
 	public function getCommit() {
172 172
 		$repo = $this->getRepository();
173
-		if($repo) {
173
+		if ($repo) {
174 174
 			try {
175 175
 				return $this->Environment()->getCommit($this->SHA);
176
-			} catch(Gitonomy\Git\Exception\ReferenceNotFoundException $ex) {
176
+			} catch (Gitonomy\Git\Exception\ReferenceNotFoundException $ex) {
177 177
 				return null;
178 178
 			}
179 179
 		}
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 		if (!$interface) {
199 199
 			return null;
200 200
 		}
201
-		return $interface->CommitURL . '/' . $this->SHA;
201
+		return $interface->CommitURL.'/'.$this->SHA;
202 202
 	}
203 203
 
204 204
 	/**
@@ -208,10 +208,10 @@  discard block
 block discarded – undo
208 208
 	 */
209 209
 	public function getCommitMessage() {
210 210
 		$commit = $this->getCommit();
211
-		if($commit) {
211
+		if ($commit) {
212 212
 			try {
213 213
 				return Convert::raw2xml($this->Environment()->getCommitMessage($commit));
214
-			} catch(Gitonomy\Git\Exception\ReferenceNotFoundException $e) {
214
+			} catch (Gitonomy\Git\Exception\ReferenceNotFoundException $e) {
215 215
 				return null;
216 216
 			}
217 217
 		}
@@ -225,13 +225,13 @@  discard block
 block discarded – undo
225 225
 	 */
226 226
 	public function getTags() {
227 227
 		$commit = $this->Environment()->getCommit($this->SHA);
228
-		if(!$commit) {
228
+		if (!$commit) {
229 229
 			return new ArrayList([]);
230 230
 		}
231 231
 		$tags = $this->Environment()->getCommitTags($commit);
232 232
 		$returnTags = [];
233 233
 		if (!empty($tags)) {
234
-			foreach($tags as $tag) {
234
+			foreach ($tags as $tag) {
235 235
 				$field = Varchar::create('Tag', '255');
236 236
 				$field->setValue($tag->getName());
237 237
 				$returnTags[] = $field;
@@ -248,12 +248,12 @@  discard block
 block discarded – undo
248 248
 	 */
249 249
 	public function getFullDeployMessages() {
250 250
 		$strategy = $this->getDeploymentStrategy();
251
-		if ($strategy->getActionCode()!=='full') return null;
251
+		if ($strategy->getActionCode() !== 'full') return null;
252 252
 
253 253
 		$changes = $strategy->getChangesModificationNeeded();
254 254
 		$messages = [];
255 255
 		foreach ($changes as $change => $details) {
256
-			if ($change==='Code version') continue;
256
+			if ($change === 'Code version') continue;
257 257
 
258 258
 			$messages[] = [
259 259
 				'Flag' => sprintf(
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 	 */
282 282
 	public function getTag() {
283 283
 		$tags = $this->getTags();
284
-		if($tags->count() > 0) {
284
+		if ($tags->count() > 0) {
285 285
 			return $tags->last();
286 286
 		}
287 287
 		return null;
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	public function getChanges() {
307 307
 		$list = new ArrayList();
308 308
 		$strategy = $this->getDeploymentStrategy();
309
-		foreach($strategy->getChanges() as $name => $change) {
309
+		foreach ($strategy->getChanges() as $name => $change) {
310 310
 			$changed = (isset($change['from']) && isset($change['to'])) ? $change['from'] != $change['to'] : null;
311 311
 			$description = isset($change['description']) ? $change['description'] : '';
312 312
 			$compareUrl = null;
@@ -356,11 +356,11 @@  discard block
 block discarded – undo
356 356
 		// Make sure we use the SHA as it was written into this DNDeployment.
357 357
 		$args['sha'] = $this->SHA;
358 358
 
359
-		if(!$this->DeployerID) {
359
+		if (!$this->DeployerID) {
360 360
 			$this->DeployerID = Member::currentUserID();
361 361
 		}
362 362
 
363
-		if($this->DeployerID) {
363
+		if ($this->DeployerID) {
364 364
 			$deployer = $this->Deployer();
365 365
 			$message = sprintf(
366 366
 				'Deploy to %s initiated by %s (%s), with IP address %s',
Please login to merge, or discard this patch.
code/model/options/NoRollbackDeployOption.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
12 12
 	}
13 13
 
14 14
 	public function __get($name) {
15
-		if (method_exists($this, 'get' . $name)) {
16
-			return $this->{'get' . $name}();
15
+		if (method_exists($this, 'get'.$name)) {
16
+			return $this->{'get'.$name}();
17 17
 		}
18 18
 		return $this->$name;
19 19
 	}
Please login to merge, or discard this patch.