@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Base class for the APINouns |
|
| 4 | - */ |
|
| 3 | + * Base class for the APINouns |
|
| 4 | + */ |
|
| 5 | 5 | class APINoun extends Controller { |
| 6 | 6 | |
| 7 | 7 | /** |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | * @return SS_HTTPResponse |
| 120 | 120 | */ |
| 121 | 121 | protected function message($message, $statusCode) { |
| 122 | - $response = $this->getAPIResponse(array( |
|
| 122 | + $response = $this->getAPIResponse(array( |
|
| 123 | 123 | 'message' => $message, |
| 124 | 124 | 'statusCode' => $statusCode |
| 125 | 125 | )); |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Surface Filesystem::sync() as a dev task in case CMS has not been included. |
|
| 4 | - */ |
|
| 3 | + * Surface Filesystem::sync() as a dev task in case CMS has not been included. |
|
| 4 | + */ |
|
| 5 | 5 | class CMSFilesystemSyncTask extends BuildTask { |
| 6 | 6 | public function run($request = null) { |
| 7 | 7 | Filesystem::sync(); |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | 'projects' => array(), |
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | - if($request->httpMethod() != 'GET') return $this->message('API not found', 404);; |
|
| 52 | + if($request->httpMethod() != 'GET') return $this->message('API not found', 404); ; |
|
| 53 | 53 | |
| 54 | 54 | foreach(DNProject::get() as $item) { |
| 55 | 55 | if($item->canView($this->getMember())) { |
@@ -1,15 +1,15 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Entry point for the deploynaut API |
|
| 4 | - * |
|
| 5 | - * /naut/api/projectname/ |
|
| 6 | - * /naut/api/projectname/environmentname |
|
| 7 | - * |
|
| 8 | - * @todo It might be good to break this out to a controller chain so that |
|
| 9 | - * "/naut/api/projectname/environmentname" controller chain becomes |
|
| 10 | - * DeploynautAPI > APIProject > APIEnvironment |
|
| 11 | - * |
|
| 12 | - */ |
|
| 3 | + * Entry point for the deploynaut API |
|
| 4 | + * |
|
| 5 | + * /naut/api/projectname/ |
|
| 6 | + * /naut/api/projectname/environmentname |
|
| 7 | + * |
|
| 8 | + * @todo It might be good to break this out to a controller chain so that |
|
| 9 | + * "/naut/api/projectname/environmentname" controller chain becomes |
|
| 10 | + * DeploynautAPI > APIProject > APIEnvironment |
|
| 11 | + * |
|
| 12 | + */ |
|
| 13 | 13 | class DeploynautAPI extends APINoun { |
| 14 | 14 | |
| 15 | 15 | /** |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | "href" => "$href/deploy", |
| 39 | 39 | "type" => "application/json", |
| 40 | 40 | "fields" => array( |
| 41 | - array( "name" => "release", "type" => "text" ), |
|
| 41 | + array("name" => "release", "type" => "text"), |
|
| 42 | 42 | ), |
| 43 | 43 | ) |
| 44 | 44 | ) |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $ping->write(); |
| 127 | 127 | $ping->start(); |
| 128 | 128 | |
| 129 | - $location = Director::absoluteBaseURL().$this->Link().'/ping/'.$ping->ID; |
|
| 129 | + $location = Director::absoluteBaseURL() . $this->Link() . '/ping/' . $ping->ID; |
|
| 130 | 130 | $output = array( |
| 131 | 131 | 'message' => 'Ping queued as job ' . $ping->ResqueToken, |
| 132 | 132 | 'href' => $location, |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $deploy->SHA = $reqBody['release']; |
| 181 | 181 | $deploy->write(); |
| 182 | 182 | $deploy->start(); |
| 183 | - $location = Director::absoluteBaseURL().$this->Link().'/deploy/'.$deploy->ID; |
|
| 183 | + $location = Director::absoluteBaseURL() . $this->Link() . '/deploy/' . $deploy->ID; |
|
| 184 | 184 | $output = array( |
| 185 | 185 | 'message' => 'Deploy queued as job ' . $deploy->ResqueToken, |
| 186 | 186 | 'href' => $location, |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | $fetch->write(); |
| 98 | 98 | $fetch->start(); |
| 99 | 99 | |
| 100 | - $location = Director::absoluteBaseURL().$this->Link().'/fetch/'.$fetch->ID; |
|
| 100 | + $location = Director::absoluteBaseURL() . $this->Link() . '/fetch/' . $fetch->ID; |
|
| 101 | 101 | $output = array( |
| 102 | 102 | 'message' => 'Ping queued as job ' . $fetch->ResqueToken, |
| 103 | 103 | 'href' => $location, |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $env = $environment->Project()->getProcessEnv(); |
| 178 | 178 | |
| 179 | 179 | if(!$args) $args = array(); |
| 180 | - $args['history_path'] = realpath(DEPLOYNAUT_LOG_PATH.'/'); |
|
| 180 | + $args['history_path'] = realpath(DEPLOYNAUT_LOG_PATH . '/'); |
|
| 181 | 181 | |
| 182 | 182 | // Inject env string directly into the command. |
| 183 | 183 | // Capistrano doesn't like the $process->setEnv($env) we'd normally do below. |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | $data = DNData::inst(); |
| 193 | 193 | // Generate a capfile from a template |
| 194 | - $capTemplate = file_get_contents(BASE_PATH.'/deploynaut/Capfile.template'); |
|
| 194 | + $capTemplate = file_get_contents(BASE_PATH . '/deploynaut/Capfile.template'); |
|
| 195 | 195 | $cap = str_replace( |
| 196 | 196 | array('<config root>', '<ssh key>', '<base path>'), |
| 197 | 197 | array($data->getEnvironmentDir(), DEPLOYNAUT_SSH_KEY, BASE_PATH), |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | if(defined('DEPLOYNAUT_CAPFILE')) { |
| 202 | 202 | $capFile = DEPLOYNAUT_CAPFILE; |
| 203 | 203 | } else { |
| 204 | - $capFile = ASSETS_PATH.'/Capfile'; |
|
| 204 | + $capFile = ASSETS_PATH . '/Capfile'; |
|
| 205 | 205 | } |
| 206 | 206 | file_put_contents($capFile, $cap); |
| 207 | 207 | |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | |
| 54 | 54 | // Default, cacheless implementation |
| 55 | 55 | } else { |
| 56 | - $filename = TEMP_FOLDER .'/' . $sha . '.tar.gz'; |
|
| 56 | + $filename = TEMP_FOLDER . '/' . $sha . '.tar.gz'; |
|
| 57 | 57 | if($this->generatePackage($sha, $repositoryDir, $outputFilename, $log)) { |
| 58 | 58 | return $filename; |
| 59 | 59 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | public function getIdentifier() { |
| 27 | 27 | // If the build script changes, don't re-use cached items |
| 28 | - return substr(sha1($this->buildScript),0,8); |
|
| 28 | + return substr(sha1($this->buildScript), 0, 8); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | protected function executeProcesses($processes, DeploynautLogFile $log) { |
| 74 | 74 | foreach($processes as $process) { |
| 75 | - $process->mustRun(function ($type, $buffer) use($log) { |
|
| 75 | + $process->mustRun(function($type, $buffer) use($log) { |
|
| 76 | 76 | $log->write($buffer); |
| 77 | 77 | }); |
| 78 | 78 | } |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | $files = glob($dir . '/*.tar.gz'); |
| 92 | 92 | if(sizeof($files) > $count) { |
| 93 | 93 | usort($files, function($a, $b) { |
| 94 | - return filemtime($a) > filemtime($b); |
|
| 94 | + return filemtime($a) > filemtime($b); |
|
| 95 | 95 | }); |
| 96 | 96 | |
| 97 | 97 | for($i=0;$i<sizeof($files)-$count;$i++) { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | return $filename; |
| 62 | 62 | |
| 63 | 63 | } else { |
| 64 | - if($this->cacheSize) $this->reduceDirSizeTo($buildPath, $this->cacheSize-1, $log); |
|
| 64 | + if($this->cacheSize) $this->reduceDirSizeTo($buildPath, $this->cacheSize - 1, $log); |
|
| 65 | 65 | |
| 66 | 66 | if($generator->generatePackage($sha, $repositoryDir, $filename, $log)) { |
| 67 | 67 | return $filename; |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | return filemtime($a) > filemtime($b); |
| 95 | 95 | }); |
| 96 | 96 | |
| 97 | - for($i=0;$i<sizeof($files)-$count;$i++) { |
|
| 97 | + for($i = 0; $i < sizeof($files) - $count; $i++) { |
|
| 98 | 98 | $log->write("Removing " . $files[$i] . " from package cache"); |
| 99 | 99 | unlink($files[$i]); |
| 100 | 100 | } |