Completed
Push — master ( bd3dee...dc4ffc )
by Stig
79:53 queued 69:24
created
code/jobs/CreateEnvJob.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 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
 		// This is a bit icky, but there is no easy way of capturing a failed deploy by using the PHP Resque
24 24
 		try {
25 25
 			$envCreate = DNCreateEnvironment::get()->byId($this->args['createID']);
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
 			$envCreate->createEnvironment();
32 32
 
33 33
 		} catch(Exception $e) {
34
-			echo "[-] CreateEnvJob failed" . PHP_EOL;
34
+			echo "[-] CreateEnvJob failed".PHP_EOL;
35 35
 			throw $e;
36 36
 		}
37 37
 		$this->updateStatus('Finished');
38
-		echo "[-] CreateEnvJob finished" . PHP_EOL;
38
+		echo "[-] CreateEnvJob finished".PHP_EOL;
39 39
 	}
40 40
 
41 41
 	/**
Please login to merge, or discard this patch.
code/jobs/DataTransferJob.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	}
21 21
 
22 22
 	public function perform() {
23
-		echo "[-] DataTransferJob starting" . PHP_EOL;
23
+		echo "[-] DataTransferJob starting".PHP_EOL;
24 24
 		$log = new DeploynautLogFile($this->args['logfile']);
25 25
 		$dataTransfer = DNDataTransfer::get()->byID($this->args['dataTransferID']);
26 26
 		$environment = $dataTransfer->Environment();
@@ -83,12 +83,12 @@  discard block
 block discarded – undo
83 83
 		} catch(RuntimeException $exc) {
84 84
 			$log->write($exc->getMessage());
85 85
 
86
-			echo "[-] DataTransferJob failed" . PHP_EOL;
86
+			echo "[-] DataTransferJob failed".PHP_EOL;
87 87
 			throw $exc;
88 88
 		}
89 89
 
90 90
 		$this->updateStatus('Finished');
91
-		echo "[-] DataTransferJob finished" . PHP_EOL;
91
+		echo "[-] DataTransferJob finished".PHP_EOL;
92 92
 	}
93 93
 
94 94
 	/**
Please login to merge, or discard this patch.
code/jobs/CloneGitRepo.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 		$path = $this->args['path'];
19 19
 		$repo = $this->args['repo'];
20 20
 		$env = $this->args['env'];
21
-		$logfile = DEPLOYNAUT_LOG_PATH . '/clonegitrepo.log';
21
+		$logfile = DEPLOYNAUT_LOG_PATH.'/clonegitrepo.log';
22 22
 		$fh = fopen($logfile, 'a');
23 23
 		if(!$fh) {
24 24
 			throw new RuntimeException(sprintf('Can\'t open file "%s" for logging.', $logfile));
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 			}
35 35
 			$command[] = sprintf('rm -rf %s', $path);
36 36
 
37
-			fwrite($fh, sprintf('[%s] Cleaning up existing repository %s', date('Y-m-d H:i:s'), $path) . PHP_EOL);
38
-			fwrite($fh, sprintf('[%s] Running command: %s', date('Y-m-d H:i:s'), implode(' ', $command)) . PHP_EOL);
37
+			fwrite($fh, sprintf('[%s] Cleaning up existing repository %s', date('Y-m-d H:i:s'), $path).PHP_EOL);
38
+			fwrite($fh, sprintf('[%s] Running command: %s', date('Y-m-d H:i:s'), implode(' ', $command)).PHP_EOL);
39 39
 
40 40
 			$process = new \Symfony\Component\Process\Process(implode(' ', $command));
41 41
 			$process->setEnv($env);
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
 					'[%s] Error cleaning up existing repository: %s',
47 47
 					date('Y-m-d H:i:s'),
48 48
 					$process->getErrorOutput()
49
-				) . PHP_EOL);
49
+				).PHP_EOL);
50 50
 				throw new RuntimeException($process->getErrorOutput());
51 51
 			}
52 52
 		}
53 53
 
54
-		fwrite($fh, sprintf('[%s] Cloning repository %s to %s', date('Y-m-d H:i:s'), $repo, $path) . PHP_EOL);
55
-		echo "[-] CloneGitRepo starting" . PHP_EOL;
54
+		fwrite($fh, sprintf('[%s] Cloning repository %s to %s', date('Y-m-d H:i:s'), $repo, $path).PHP_EOL);
55
+		echo "[-] CloneGitRepo starting".PHP_EOL;
56 56
 
57 57
 		$command = array();
58 58
 		if(!empty($user)) {
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		}
61 61
 		$command[] = sprintf('git clone --bare -q %s %s', $repo, $path);
62 62
 
63
-		fwrite($fh, sprintf('[%s] Running command: %s', date('Y-m-d H:i:s'), implode(' ', $command)) . PHP_EOL);
63
+		fwrite($fh, sprintf('[%s] Running command: %s', date('Y-m-d H:i:s'), implode(' ', $command)).PHP_EOL);
64 64
 
65 65
 		$process = new \Symfony\Component\Process\Process(implode(' ', $command));
66 66
 		$process->setEnv($env);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 				$repo,
74 74
 				$path,
75 75
 				$process->getErrorOutput()
76
-			) . PHP_EOL);
76
+			).PHP_EOL);
77 77
 			throw new RuntimeException($process->getErrorOutput());
78 78
 		}
79 79
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 			date('Y-m-d H:i:s'),
83 83
 			$repo,
84 84
 			$path
85
-		) . PHP_EOL);
85
+		).PHP_EOL);
86 86
 	}
87 87
 
88 88
 }
Please login to merge, or discard this patch.
code/jobs/FetchJob.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 		$path = $project->getLocalCVSPath();
24 24
 		$env = $this->args['env'];
25 25
 
26
-		$log->write('Starting git fetch for project "' . $project->Name . '"');
26
+		$log->write('Starting git fetch for project "'.$project->Name.'"');
27 27
 
28 28
 		// if an alternate user has been configured for clone, run the command as that user
29 29
 		// @todo Gitonomy doesn't seem to have any way to prefix the command properly, if you
Please login to merge, or discard this patch.
code/model/DNProject.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 	 * @return bool
257 257
 	 */
258 258
 	public function canRestore($member = null) {
259
-		if ($this->allowedAny(
259
+		if($this->allowedAny(
260 260
 			array(
261 261
 				DNRoot::ALLOW_PROD_SNAPSHOT,
262 262
 				DNRoot::ALLOW_NON_PROD_SNAPSHOT
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 	 * @return bool
277 277
 	 */
278 278
 	public function canBackup($member = null) {
279
-		if ($this->allowedAny(
279
+		if($this->allowedAny(
280 280
 			array(
281 281
 				DNRoot::ALLOW_PROD_SNAPSHOT,
282 282
 				DNRoot::ALLOW_NON_PROD_SNAPSHOT
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	 * @return bool
297 297
 	 */
298 298
 	public function canUploadArchive($member = null) {
299
-		if ($this->allowedAny(
299
+		if($this->allowedAny(
300 300
 			array(
301 301
 				DNRoot::ALLOW_PROD_SNAPSHOT,
302 302
 				DNRoot::ALLOW_NON_PROD_SNAPSHOT
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 	 * @return bool
317 317
 	 */
318 318
 	public function canDownloadArchive($member = null) {
319
-		if ($this->allowedAny(
319
+		if($this->allowedAny(
320 320
 			array(
321 321
 				DNRoot::ALLOW_PROD_SNAPSHOT,
322 322
 				DNRoot::ALLOW_NON_PROD_SNAPSHOT
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 			// Key-pair is available, use it.
386 386
 			$processEnv = array(
387 387
 				'IDENT_KEY' => $this->getPrivateKeyPath(),
388
-				'GIT_SSH' => BASE_PATH . "/deploynaut/git-deploy.sh"
388
+				'GIT_SSH' => BASE_PATH."/deploynaut/git-deploy.sh"
389 389
 			);
390 390
 		} else {
391 391
 			$processEnv = array();
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 	 * @return bool
647 647
 	 */
648 648
 	public function repoExists() {
649
-		return file_exists(DEPLOYNAUT_LOCAL_VCS_PATH . '/' . $this->Name.'/HEAD');
649
+		return file_exists(DEPLOYNAUT_LOCAL_VCS_PATH.'/'.$this->Name.'/HEAD');
650 650
 	}
651 651
 
652 652
 	/**
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
 	 * @return string
665 665
 	 */
666 666
 	public function getLocalCVSPath() {
667
-		return DEPLOYNAUT_LOCAL_VCS_PATH . '/' . $this->Name;
667
+		return DEPLOYNAUT_LOCAL_VCS_PATH.'/'.$this->Name;
668 668
 	}
669 669
 
670 670
 	/**
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
 	 */
741 741
 	public function getPublicKeyPath() {
742 742
 		if($privateKey = $this->getPrivateKeyPath()) {
743
-			return $privateKey . '.pub';
743
+			return $privateKey.'.pub';
744 744
 		}
745 745
 		return null;
746 746
 	}
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
 		if(!empty($keyDir)) {
756 756
 			$filter = FileNameFilter::create();
757 757
 			$name = $filter->filter($this->Name);
758
-			return $keyDir . '/' . $name;
758
+			return $keyDir.'/'.$name;
759 759
 		}
760 760
 		return null;
761 761
 	}
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 		$filter = FileNameFilter::create();
775 775
 		$name = $filter->filter($this->Name);
776 776
 
777
-		return $this->DNData()->getKeyDir() . '/' . $name;
777
+		return $this->DNData()->getKeyDir().'/'.$name;
778 778
 	}
779 779
 
780 780
 	/**
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 		/* Look for each whitelisted hostname */
862 862
 		foreach($interfaces as $host => $interface) {
863 863
 			/* See if the CVS Path is for this hostname, followed by some junk (maybe a port), then the path */
864
-			if(preg_match('{^[^.]*' . $host . '(.*?)([/a-zA-Z].+)}', $this->CVSPath, $match)) {
864
+			if(preg_match('{^[^.]*'.$host.'(.*?)([/a-zA-Z].+)}', $this->CVSPath, $match)) {
865 865
 
866 866
 				$path = $match[2];
867 867
 
@@ -872,10 +872,10 @@  discard block
 block discarded – undo
872 872
 				$components = explode('.', $host);
873 873
 
874 874
 				foreach($regex as $pattern => $replacement) {
875
-					$path = preg_replace('/' . $pattern . '/', $replacement, $path);
875
+					$path = preg_replace('/'.$pattern.'/', $replacement, $path);
876 876
 				}
877 877
 
878
-				$uxurl = Controller::join_links($scheme . '://', $host, $path);
878
+				$uxurl = Controller::join_links($scheme.'://', $host, $path);
879 879
 
880 880
 				if(array_key_exists('commit', $interface) && $interface['commit'] == false) {
881 881
 					$commiturl = false;
@@ -959,14 +959,14 @@  discard block
 block discarded – undo
959 959
 	 * @return bool
960 960
 	 */
961 961
 	public function allowedAny($codes, $member = null) {
962
-		if (!$member) {
962
+		if(!$member) {
963 963
 			$member = Member::currentUser();
964 964
 		}
965 965
 
966 966
 		if(Permission::checkMember($member, 'ADMIN')) return true;
967 967
 
968 968
 		$hits = $this->whoIsAllowedAny($codes)->filter('Member.ID', $member->ID)->count();
969
-		return ($hits>0 ? true : false);
969
+		return ($hits > 0 ? true : false);
970 970
 	}
971 971
 
972 972
 }
Please login to merge, or discard this patch.
code/control/DNRoot.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 			)
184 184
 		);
185 185
 
186
-		if (\Director::isDev()) {
186
+		if(\Director::isDev()) {
187 187
 			\Requirements::javascript('deploynaut/static/bundle-debug.js');
188 188
 		} else {
189 189
 			\Requirements::javascript('deploynaut/static/bundle.js');
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 		}
246 246
 
247 247
 		// Block framework jquery
248
-		Requirements::block(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
248
+		Requirements::block(FRAMEWORK_DIR.'/thirdparty/jquery/jquery.js');
249 249
 
250 250
 		self::include_requirements();
251 251
 	}
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 	 * @return \SS_HTTPResponse
265 265
 	 */
266 266
 	public function index(SS_HTTPRequest $request) {
267
-		return $this->redirect($this->Link() . 'projects/');
267
+		return $this->redirect($this->Link().'projects/');
268 268
 	}
269 269
 
270 270
 	/**
@@ -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
 	}
@@ -472,7 +472,7 @@  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 477
 		$cleanupFn = function() use($workingDir, $dataTransfer, $dataArchive) {
478 478
 			$process = new Process(sprintf('rm -rf %s', escapeshellarg($workingDir)));
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
 		$form->disableSecurityToken();
573 573
 		$form->addExtraClass('fields-wide');
574 574
 		// Tweak the action so it plays well with our fake URL structure.
575
-		$form->setFormAction($project->Link() . '/PostSnapshotForm');
575
+		$form->setFormAction($project->Link().'/PostSnapshotForm');
576 576
 
577 577
 		return $form;
578 578
 	}
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
 		$branchName = $request->getVar('name');
711 711
 		$branch = $project->DNBranchList()->byName($branchName);
712 712
 		if(!$branch) {
713
-			return new SS_HTTPResponse("Branch '" . Convert::raw2xml($branchName) . "' not found.", 404);
713
+			return new SS_HTTPResponse("Branch '".Convert::raw2xml($branchName)."' not found.", 404);
714 714
 		}
715 715
 
716 716
 		return $this->render(array(
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
 		);
945 945
 
946 946
 		// Tweak the action so it plays well with our fake URL structure.
947
-		$form->setFormAction($project->Link() . '/CreateEnvironmentForm');
947
+		$form->setFormAction($project->Link().'/CreateEnvironmentForm');
948 948
 
949 949
 		return $form;
950 950
 	}
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
 		$job->write();
978 978
 		$job->start();
979 979
 
980
-		return $this->redirect($project->Link('createenv') . '/' . $job->ID);
980
+		return $this->redirect($project->Link('createenv').'/'.$job->ID);
981 981
 	}
982 982
 
983 983
 	/**
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
 	 */
1036 1036
 	public function getPlatformSpecificStrings() {
1037 1037
 		$strings = $this->config()->platform_specific_strings;
1038
-		if ($strings) {
1038
+		if($strings) {
1039 1039
 			return new ArrayList($strings);
1040 1040
 		}
1041 1041
 	}
@@ -1159,7 +1159,7 @@  discard block
 block discarded – undo
1159 1159
 			return $body;
1160 1160
 		}
1161 1161
 
1162
-		$form->setFormAction($this->getRequest()->getURL() . '/DeployForm');
1162
+		$form->setFormAction($this->getRequest()->getURL().'/DeployForm');
1163 1163
 		return $form;
1164 1164
 	}
1165 1165
 
@@ -1433,7 +1433,7 @@  discard block
 block discarded – undo
1433 1433
 		$deployment->start();
1434 1434
 
1435 1435
 		return json_encode(array(
1436
-			'url' => Director::absoluteBaseURL() . $deployment->Link()
1436
+			'url' => Director::absoluteBaseURL().$deployment->Link()
1437 1437
 		), JSON_PRETTY_PRINT);
1438 1438
 	}
1439 1439
 
@@ -1540,7 +1540,7 @@  discard block
 block discarded – undo
1540 1540
 					->addExtraClass('btn')
1541 1541
 			)
1542 1542
 		);
1543
-		$form->setFormAction($this->getRequest()->getURL() . '/DataTransferForm');
1543
+		$form->setFormAction($this->getRequest()->getURL().'/DataTransferForm');
1544 1544
 
1545 1545
 		return $form;
1546 1546
 	}
@@ -1742,7 +1742,7 @@  discard block
 block discarded – undo
1742 1742
 					->addExtraClass('btn')
1743 1743
 			)
1744 1744
 		);
1745
-		$form->setFormAction($project->Link() . '/DataTransferRestoreForm');
1745
+		$form->setFormAction($project->Link().'/DataTransferRestoreForm');
1746 1746
 
1747 1747
 		return $form;
1748 1748
 	}
@@ -1840,7 +1840,7 @@  discard block
 block discarded – undo
1840 1840
 					->addExtraClass('btn')
1841 1841
 			)
1842 1842
 		);
1843
-		$form->setFormAction($project->Link() . '/DeleteForm');
1843
+		$form->setFormAction($project->Link().'/DeleteForm');
1844 1844
 
1845 1845
 		return $form;
1846 1846
 	}
@@ -1946,7 +1946,7 @@  discard block
 block discarded – undo
1946 1946
 					->addExtraClass('btn')
1947 1947
 			)
1948 1948
 		);
1949
-		$form->setFormAction($this->getCurrentProject()->Link() . '/MoveForm');
1949
+		$form->setFormAction($this->getCurrentProject()->Link().'/MoveForm');
1950 1950
 
1951 1951
 		return $form;
1952 1952
 	}
@@ -2245,7 +2245,7 @@  discard block
 block discarded – undo
2245 2245
 	 */
2246 2246
 	protected function project404Response() {
2247 2247
 		return new SS_HTTPResponse(
2248
-			"Project '" . Convert::raw2xml($this->getRequest()->param('Project')) . "' not found.",
2248
+			"Project '".Convert::raw2xml($this->getRequest()->param('Project'))."' not found.",
2249 2249
 			404
2250 2250
 		);
2251 2251
 	}
@@ -2255,7 +2255,7 @@  discard block
 block discarded – undo
2255 2255
 	 */
2256 2256
 	protected function environment404Response() {
2257 2257
 		$envName = Convert::raw2xml($this->getRequest()->param('Environment'));
2258
-		return new SS_HTTPResponse("Environment '" . $envName . "' not found.", 404);
2258
+		return new SS_HTTPResponse("Environment '".$envName."' not found.", 404);
2259 2259
 	}
2260 2260
 
2261 2261
 	/**
@@ -2324,7 +2324,7 @@  discard block
 block discarded – undo
2324 2324
 	public function AmbientMenu() {
2325 2325
 		$list = new ArrayList();
2326 2326
 
2327
-		if (Member::currentUserID()) {
2327
+		if(Member::currentUserID()) {
2328 2328
 			$list->push(new ArrayData(array(
2329 2329
 				'Classes' => 'logout',
2330 2330
 				'FaIcon' => 'sign-out',
Please login to merge, or discard this patch.
code/api/nouns/APIProject.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,9 +87,9 @@
 block discarded – undo
87 87
 		$fetch->write();
88 88
 		$fetch->start();
89 89
 
90
-		$location = Director::absoluteBaseURL() . $this->Link() . '/fetch/' . $fetch->ID;
90
+		$location = Director::absoluteBaseURL().$this->Link().'/fetch/'.$fetch->ID;
91 91
 		$output = array(
92
-			'message' => 'Ping queued as job ' . $fetch->ResqueToken,
92
+			'message' => 'Ping queued as job '.$fetch->ResqueToken,
93 93
 			'href' => $location,
94 94
 		);
95 95
 
Please login to merge, or discard this patch.