diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index f7aa95e734..c1ecdd9d61 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -162,7 +162,7 @@ App::get('/v1/functions') $base32 = new Base32(); $projectIdHash = \rtrim($base32->encode($projectId), '='); $functions = $dbForProject->find('functions', $queries); - $functions = \array_map(function(Document $function) use($functionsDomain, $projectIdHash, $base32) { + $functions = \array_map(function (Document $function) use ($functionsDomain, $projectIdHash, $base32) { $functionId = $function->getId(); $functionIdHash = \rtrim($base32->encode($functionId), '='); $function = $function->setAttribute('url', "{$functionIdHash}-{$projectIdHash}.{$functionsDomain}"); diff --git a/app/controllers/general.php b/app/controllers/general.php index 60769894fc..27f3e342e8 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -67,18 +67,18 @@ App::init() $host = $swooleRequest->header['host'] ?? ''; // Function Preview - if(\str_ends_with($host, App::getEnv('_APP_DOMAIN_FUNCTIONS'))) { + if (\str_ends_with($host, App::getEnv('_APP_DOMAIN_FUNCTIONS'))) { // Remove domain from host $previewDomain = App::getEnv('_APP_DOMAIN_FUNCTIONS'); $host = \substr($host, 0, -1 * (1 + \strlen($previewDomain))); // +1 for starting dot (.) - if(empty($host) || \str_contains($host, '.')) { + if (empty($host) || \str_contains($host, '.')) { throw new AppwriteException(AppwriteException::ROUTER_INVALID_URL); } $ids = explode('-', $host); - if(\count($ids) !== 2) { + if (\count($ids) !== 2) { throw new AppwriteException(AppwriteException::ROUTER_INVALID_URL); } @@ -120,15 +120,15 @@ App::init() \curl_close($ch); - if($errNo !== 0) { + if ($errNo !== 0) { return $response->setStatusCode(500)->send("Internal error: " . $error); } - if($statusCode >= 400) { + if ($statusCode >= 400) { $error = \json_decode($executionResponse, true)['message']; return $response->setStatusCode(500)->send("Execution error: " . $error); } - + $execution = \json_decode($executionResponse, true); foreach ($execution['headers'] as $header => $value) { @@ -137,20 +137,20 @@ App::init() $body = $execution['body'] ?? ''; - if(($execution['headers']['x-open-runtimes-encoding'] ?? '') === 'base64') { + if (($execution['headers']['x-open-runtimes-encoding'] ?? '') === 'base64') { $body = \base64_decode($body); } return $response->setStatusCode($execution['statusCode'] ?? 200)->send($body); } - + /* * Request format */ $route = $utopia->getRoute(); Request::setRoute($route); - if($route === null) { + if ($route === null) { return $response->setStatusCode(404)->send("Not Found"); } @@ -729,7 +729,7 @@ App::get('/.well-known/acme-challenge') include_once __DIR__ . '/shared/api.php'; App::wildcard() - ->action(function() { + ->action(function () { throw new AppwriteException(AppwriteException::GENERAL_ROUTE_NOT_FOUND); }); diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 47a21c27f1..04f797fdf3 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -236,10 +236,6 @@ class Executor $responseType = $responseHeaders['content-type'] ?? ''; $responseStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); - \var_dump($responseBody); - \var_dump($responseStatus); - \var_dump($responseHeaders); - if ($decode) { switch (substr($responseType, 0, strpos($responseType, ';'))) { case 'application/json':