mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
format files in app, src, tests
This commit is contained in:
+18
-18
@@ -36,9 +36,9 @@ class Executor
|
||||
|
||||
/**
|
||||
* Create runtime
|
||||
*
|
||||
*
|
||||
* Launches a runtime container for a deployment ready for execution
|
||||
*
|
||||
*
|
||||
* @param string $deploymentId
|
||||
* @param string $projectId
|
||||
* @param string $source
|
||||
@@ -53,10 +53,10 @@ class Executor
|
||||
* @param array $commands
|
||||
*/
|
||||
public function createRuntime(
|
||||
string $deploymentId,
|
||||
string $projectId,
|
||||
string $deploymentId,
|
||||
string $projectId,
|
||||
string $source,
|
||||
string $runtime,
|
||||
string $runtime,
|
||||
string $baseImage,
|
||||
bool $remove = false,
|
||||
string $entrypoint = '',
|
||||
@@ -90,16 +90,16 @@ class Executor
|
||||
$status = $response['headers']['status-code'];
|
||||
if ($status >= 400) {
|
||||
throw new \Exception($response['body']['message'], $status);
|
||||
}
|
||||
}
|
||||
|
||||
return $response['body'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Runtime
|
||||
*
|
||||
*
|
||||
* Deletes a runtime and cleans up any containers remaining.
|
||||
*
|
||||
*
|
||||
* @param string $projectId
|
||||
* @param string $deploymentId
|
||||
*/
|
||||
@@ -115,7 +115,7 @@ class Executor
|
||||
$params = [];
|
||||
|
||||
$response = $this->call(self::METHOD_DELETE, $route, $headers, $params, true, 30);
|
||||
|
||||
|
||||
$status = $response['headers']['status-code'];
|
||||
if ($status >= 400) {
|
||||
throw new \Exception($response['body']['message'], $status);
|
||||
@@ -126,7 +126,7 @@ class Executor
|
||||
|
||||
/**
|
||||
* Create an execution
|
||||
*
|
||||
*
|
||||
* @param string $projectId
|
||||
* @param string $deploymentId
|
||||
* @param string $path
|
||||
@@ -136,7 +136,7 @@ class Executor
|
||||
* @param string runtime
|
||||
* @param string $baseImage
|
||||
* @param int $timeout
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function createExecution(
|
||||
@@ -157,7 +157,7 @@ class Executor
|
||||
];
|
||||
$params = [
|
||||
'runtimeId' => "$projectId-$deploymentId",
|
||||
'vars' => $vars,
|
||||
'vars' => $vars,
|
||||
'data' => $data,
|
||||
'timeout' => $timeout,
|
||||
];
|
||||
@@ -248,7 +248,7 @@ class Executor
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
|
||||
curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$responseHeaders) {
|
||||
$len = strlen($header);
|
||||
@@ -277,18 +277,18 @@ class Executor
|
||||
$responseType = $responseHeaders['content-type'] ?? '';
|
||||
$responseStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
||||
if($decode) {
|
||||
if ($decode) {
|
||||
switch (substr($responseType, 0, strpos($responseType, ';'))) {
|
||||
case 'application/json':
|
||||
$json = json_decode($responseBody, true);
|
||||
|
||||
|
||||
if ($json === null) {
|
||||
throw new Exception('Failed to parse response: '.$responseBody);
|
||||
throw new Exception('Failed to parse response: ' . $responseBody);
|
||||
}
|
||||
|
||||
|
||||
$responseBody = $json;
|
||||
$json = null;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user