Skip to content

Commit ef0ac82

Browse files
committed
Fix header casting and more minor fixes
1 parent 064ce41 commit ef0ac82

File tree

6 files changed

+10
-26
lines changed

6 files changed

+10
-26
lines changed

app/Appwrite/services/client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
$cli
110110
->task('version')
111111
->action(function() {
112-
Console::log('CLI Version : 0.10.0');
112+
Console::log('CLI Version : 0.10.1');
113113
Console::log('Server Version : 0.8.0');
114114
});
115115

app/Appwrite/services/functions.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -301,25 +301,14 @@
301301
->action(function ( $functionId, $command, $code ) use ($parser) {
302302
/** @var string $functionId */
303303
/** @var string $command */
304-
/** @var file $code */
304+
/** @var string $code */
305305

306306
$client = new Client();
307307
$path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/tags');
308308
$params = [];
309309
/** Body Params */
310310
$params['command'] = $command;
311-
$cloudFunctionPath = realpath(__DIR__.'/../../../files/'.$code);
312-
$cloudFunctionParentDir = dirname($cloudFunctionPath, 1);
313-
$cloudFunctionDirName = basename($cloudFunctionPath);
314-
if (file_exists($cloudFunctionPath) === false ) {
315-
throw new Exception("Path doesn't exist. Please ensure that the path is within the current directory. ");
316-
}
317-
$archiveName = 'code.tar.gz';
318-
$volumeMountPoint = realpath(__DIR__.'/../../../files/');
319-
exec("tar -zcvf $archiveName -C $cloudFunctionParentDir $cloudFunctionDirName && mv $archiveName $volumeMountPoint");
320-
$archivePath = realpath($volumeMountPoint."/$archiveName");
321-
$cFile = new \CURLFile($archivePath, 'application/x-gzip' , basename($archivePath));
322-
$params['code'] = $cFile;
311+
$params['code'] = $code;
323312
$response = $client->call(Client::METHOD_POST, $path, [
324313
'content-type' => 'multipart/form-data',
325314
], $params);

app/Appwrite/services/storage.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,15 @@
7676
->param('read', [] , new Wildcard() , 'An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', true)
7777
->param('write', [] , new Wildcard() , 'An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', true)
7878
->action(function ( $file, $read, $write ) use ($parser) {
79-
/** @var file $file */
79+
/** @var string $file */
8080
/** @var array $read */
8181
/** @var array $write */
8282

8383
$client = new Client();
8484
$path = str_replace([], [], '/storage/files');
8585
$params = [];
8686
/** Body Params */
87-
$file = realpath(__DIR__.'/../../../files/'.$file);
88-
if (file_exists($file) === false ) {
89-
throw new Exception("Path doesn't exist. Please ensure that the path is within the current directory. ");
90-
}
91-
$cFile = new \CURLFile($file, 'image/png' , basename($file));
92-
$params['file'] = $cFile;
87+
$params['file'] = $file;
9388
$params['read'] = !is_array($read) ? array($read) : $read;
9489
$params['write'] = !is_array($write) ? array($write) : $write;
9590
$response = $client->call(Client::METHOD_POST, $path, [
@@ -191,7 +186,7 @@
191186
/** @var integer $borderWidth */
192187
/** @var string $borderColor */
193188
/** @var integer $borderRadius */
194-
/** @var integer $opacity */
189+
/** @var number $opacity */
195190
/** @var integer $rotation */
196191
/** @var string $background */
197192
/** @var string $output */

install.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ $APPWRITE_EXECUTABLE_FILEPATH = Join-Path -Path $APPWRITE_INSTALL_DIR -ChildPath
2525
$APPWRITE_CLI_IMAGE_NAME = "appwrite/cli"
2626

2727
# Appwrite CLI image version
28-
$APPWRITE_CLI_IMAGE_VERSION = "0.10.0"
28+
$APPWRITE_CLI_IMAGE_VERSION = "0.10.1"
2929

3030
$APPWRITE_EXECUTABLE_CONTENT = @"
3131
`$allowList = 'version', 'help', 'init', 'client' , 'account', 'avatars', 'database', 'functions', 'health', 'locale', 'storage', 'teams', 'users'

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ APPWRITE_TEMP_NAME=temp
3030
APPWRITE_CLI_IMAGE_NAME=appwrite/cli
3131

3232
# Appwrite CLI image version
33-
APPWRITE_CLI_IMAGE_VERSION=0.10.0
33+
APPWRITE_CLI_IMAGE_VERSION=0.10.1
3434

3535
# sudo is required to copy executable to APPWRITE_INSTALL_DIR for linux
3636
USE_SUDO="false"

src/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Client
2929
*/
3030
private $headers = [
3131
'content-type' => '',
32-
'x-sdk-version' => 'appwrite:cli:0.10.0',
32+
'x-sdk-version' => 'appwrite:cli:0.10.1',
3333
'X-Appwrite-Response-Format' => '0.8.0' ];
3434

3535
/**
@@ -187,7 +187,7 @@ public function setLocale($value)
187187
*/
188188
public function addHeader($key, $value)
189189
{
190-
$this->headers[strtolower($key)] = strtolower($value);
190+
$this->headers[strtolower($key)] = $value;
191191

192192
return $this;
193193
}

0 commit comments

Comments
 (0)