@@ -179,7 +179,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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,13 +1480,13 @@ discard block |
||
1480 | 1480 | |
1481 | 1481 | // remove environments that hasn't yet been deployed to |
1482 | 1482 | $validEnvs = ArrayList::create(); |
1483 | - foreach($envs as $env) { |
|
1483 | + foreach ($envs as $env) { |
|
1484 | 1484 | if ($env->CurrentBuild() !== false) { |
1485 | 1485 | $validEnvs->Add($env); |
1486 | 1486 | } |
1487 | 1487 | } |
1488 | 1488 | |
1489 | - $envsField = DropdownField::create('EnvironmentID', 'Environment', $validEnvs->map()) |
|
1489 | + $envsField = DropdownField::create('EnvironmentID', 'Environment', $validEnvs->map()) |
|
1490 | 1490 | ->setEmptyString('Select an environment'); |
1491 | 1491 | $formAction = FormAction::create('doDataTransfer', 'Create') |
1492 | 1492 | ->addExtraClass('btn'); |
@@ -1507,7 +1507,7 @@ discard block |
||
1507 | 1507 | ), |
1508 | 1508 | FieldList::create($formAction) |
1509 | 1509 | ); |
1510 | - $form->setFormAction($this->getRequest()->getURL() . '/DataTransferForm'); |
|
1510 | + $form->setFormAction($this->getRequest()->getURL().'/DataTransferForm'); |
|
1511 | 1511 | |
1512 | 1512 | return $form; |
1513 | 1513 | } |
@@ -1533,12 +1533,12 @@ discard block |
||
1533 | 1533 | // Validate direction. |
1534 | 1534 | if ($data['Direction'] == 'get') { |
1535 | 1535 | $validEnvs = $this->getCurrentProject()->DNEnvironmentList() |
1536 | - ->filterByCallback(function ($item) { |
|
1536 | + ->filterByCallback(function($item) { |
|
1537 | 1537 | return $item->canBackup(); |
1538 | 1538 | }); |
1539 | 1539 | } else if ($data['Direction'] == 'push') { |
1540 | 1540 | $validEnvs = $this->getCurrentProject()->DNEnvironmentList() |
1541 | - ->filterByCallback(function ($item) { |
|
1541 | + ->filterByCallback(function($item) { |
|
1542 | 1542 | return $item->canRestore(); |
1543 | 1543 | }); |
1544 | 1544 | } else { |
@@ -1669,7 +1669,7 @@ discard block |
||
1669 | 1669 | |
1670 | 1670 | // Performs canView permission check by limiting visible projects |
1671 | 1671 | $project = $this->getCurrentProject(); |
1672 | - $envs = $project->DNEnvironmentList()->filterByCallback(function ($item) { |
|
1672 | + $envs = $project->DNEnvironmentList()->filterByCallback(function($item) { |
|
1673 | 1673 | return $item->canRestore(); |
1674 | 1674 | }); |
1675 | 1675 | |
@@ -1694,7 +1694,7 @@ discard block |
||
1694 | 1694 | |
1695 | 1695 | // remove environments that hasn't yet been deployed to |
1696 | 1696 | $validEnvs = ArrayList::create(); |
1697 | - foreach($envs as $env) { |
|
1697 | + foreach ($envs as $env) { |
|
1698 | 1698 | if ($env->CurrentBuild() !== false) { |
1699 | 1699 | $validEnvs->Add($env); |
1700 | 1700 | } |
@@ -1722,7 +1722,7 @@ discard block |
||
1722 | 1722 | ), |
1723 | 1723 | FieldList::create($formAction) |
1724 | 1724 | ); |
1725 | - $form->setFormAction($project->Link() . '/DataTransferRestoreForm'); |
|
1725 | + $form->setFormAction($project->Link().'/DataTransferRestoreForm'); |
|
1726 | 1726 | |
1727 | 1727 | return $form; |
1728 | 1728 | } |
@@ -1820,7 +1820,7 @@ discard block |
||
1820 | 1820 | ->addExtraClass('btn') |
1821 | 1821 | ) |
1822 | 1822 | ); |
1823 | - $form->setFormAction($project->Link() . '/DeleteForm'); |
|
1823 | + $form->setFormAction($project->Link().'/DeleteForm'); |
|
1824 | 1824 | |
1825 | 1825 | return $form; |
1826 | 1826 | } |
@@ -1926,7 +1926,7 @@ discard block |
||
1926 | 1926 | ->addExtraClass('btn') |
1927 | 1927 | ) |
1928 | 1928 | ); |
1929 | - $form->setFormAction($this->getCurrentProject()->Link() . '/MoveForm'); |
|
1929 | + $form->setFormAction($this->getCurrentProject()->Link().'/MoveForm'); |
|
1930 | 1930 | |
1931 | 1931 | return $form; |
1932 | 1932 | } |
@@ -2187,7 +2187,7 @@ discard block |
||
2187 | 2187 | $transfers = DNDataTransfer::get() |
2188 | 2188 | ->filter('EnvironmentID', $environments) |
2189 | 2189 | ->filterByCallback( |
2190 | - function ($record) { |
|
2190 | + function($record) { |
|
2191 | 2191 | return |
2192 | 2192 | $record->Environment()->canRestore() || // Ensure member can perform an action on the transfers env |
2193 | 2193 | $record->Environment()->canBackup() || |
@@ -2312,7 +2312,7 @@ discard block |
||
2312 | 2312 | */ |
2313 | 2313 | protected function project404Response() { |
2314 | 2314 | return new SS_HTTPResponse( |
2315 | - "Project '" . Convert::raw2xml($this->getRequest()->param('Project')) . "' not found.", |
|
2315 | + "Project '".Convert::raw2xml($this->getRequest()->param('Project'))."' not found.", |
|
2316 | 2316 | 404 |
2317 | 2317 | ); |
2318 | 2318 | } |
@@ -2322,7 +2322,7 @@ discard block |
||
2322 | 2322 | */ |
2323 | 2323 | protected function environment404Response() { |
2324 | 2324 | $envName = Convert::raw2xml($this->getRequest()->param('Environment')); |
2325 | - return new SS_HTTPResponse("Environment '" . $envName . "' not found.", 404); |
|
2325 | + return new SS_HTTPResponse("Environment '".$envName."' not found.", 404); |
|
2326 | 2326 | } |
2327 | 2327 | |
2328 | 2328 | /** |