Skip to content

Commit 1d043f5

Browse files
authored
Merge pull request #32 from appwrite/dev
Dev
2 parents 17bb9d4 + af59393 commit 1d043f5

File tree

6 files changed

+44
-21
lines changed

6 files changed

+44
-21
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Appwrite PHP SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?style=flat-square&v=1)
4-
![Version](https://img.shields.io/badge/api%20version-1.5.6-blue.svg?style=flat-square&v=1)
4+
![Version](https://img.shields.io/badge/api%20version-1.5.7-blue.svg?style=flat-square&v=1)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

src/Appwrite/Client.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ class Client
3737
*/
3838
protected $headers = [
3939
'content-type' => '',
40-
'user-agent' => 'AppwritePHPSDK/11.0.2 ()',
40+
'user-agent' => 'AppwritePHPSDK/11.1.0 ()',
4141
'x-sdk-name'=> 'PHP',
4242
'x-sdk-platform'=> 'server',
4343
'x-sdk-language'=> 'php',
44-
'x-sdk-version'=> '11.0.2',
44+
'x-sdk-version'=> '11.1.0',
4545
];
4646

4747
/**
@@ -249,6 +249,13 @@ public function call($method, $path = '', $headers = array(), array $params = ar
249249
$responseBody = curl_exec($ch);
250250
$contentType = $responseHeaders['content-type'] ?? '';
251251
$responseStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
252+
253+
$warnings = $responseHeaders['x-appwrite-warning'] ?? '';
254+
if ($warnings) {
255+
foreach(explode(';', $warnings) as $warning) {
256+
echo 'Warning: ' . $warning . PHP_EOL;
257+
}
258+
}
252259

253260
switch(substr($contentType, 0, strpos($contentType, ';'))) {
254261
case 'application/json':

src/Appwrite/Enums/Name.php

-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class Name implements JsonSerializable
1818
private static Name $V1BUILDS;
1919
private static Name $V1MESSAGING;
2020
private static Name $V1MIGRATIONS;
21-
private static Name $HAMSTERV1;
2221

2322
private string $value;
2423

@@ -121,11 +120,4 @@ public static function V1MIGRATIONS(): Name
121120
}
122121
return self::$V1MIGRATIONS;
123122
}
124-
public static function HAMSTERV1(): Name
125-
{
126-
if (!isset(self::$HAMSTERV1)) {
127-
self::$HAMSTERV1 = new Name('hamsterv1');
128-
}
129-
return self::$HAMSTERV1;
130-
}
131123
}

src/Appwrite/Enums/Runtime.php

+24
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class Runtime implements JsonSerializable
2626
private static Runtime $PYTHON311;
2727
private static Runtime $PYTHON312;
2828
private static Runtime $PYTHONML311;
29+
private static Runtime $DENO121;
30+
private static Runtime $DENO124;
31+
private static Runtime $DENO135;
2932
private static Runtime $DENO140;
3033
private static Runtime $DART215;
3134
private static Runtime $DART216;
@@ -209,6 +212,27 @@ public static function PYTHONML311(): Runtime
209212
}
210213
return self::$PYTHONML311;
211214
}
215+
public static function DENO121(): Runtime
216+
{
217+
if (!isset(self::$DENO121)) {
218+
self::$DENO121 = new Runtime('deno-1.21');
219+
}
220+
return self::$DENO121;
221+
}
222+
public static function DENO124(): Runtime
223+
{
224+
if (!isset(self::$DENO124)) {
225+
self::$DENO124 = new Runtime('deno-1.24');
226+
}
227+
return self::$DENO124;
228+
}
229+
public static function DENO135(): Runtime
230+
{
231+
if (!isset(self::$DENO135)) {
232+
self::$DENO135 = new Runtime('deno-1.35');
233+
}
234+
return self::$DENO135;
235+
}
212236
public static function DENO140(): Runtime
213237
{
214238
if (!isset(self::$DENO140)) {

src/Appwrite/Services/Databases.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -876,15 +876,15 @@ public function updateEnumAttribute(string $databaseId, string $collectionId, st
876876
* @param string $collectionId
877877
* @param string $key
878878
* @param bool $required
879-
* @param int $min
880-
* @param int $max
881-
* @param int $xdefault
879+
* @param float $min
880+
* @param float $max
881+
* @param float $xdefault
882882
* @param bool $xarray
883883
* @throws AppwriteException
884884
* @return array
885885
886886
*/
887-
public function createFloatAttribute(string $databaseId, string $collectionId, string $key, bool $required, int $min = null, int $max = null, int $xdefault = null, bool $xarray = null): array
887+
public function createFloatAttribute(string $databaseId, string $collectionId, string $key, bool $required, float $min = null, float $max = null, float $xdefault = null, bool $xarray = null): array
888888
{
889889
$apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/attributes/float');
890890

@@ -940,14 +940,14 @@ public function createFloatAttribute(string $databaseId, string $collectionId, s
940940
* @param string $collectionId
941941
* @param string $key
942942
* @param bool $required
943-
* @param int $min
944-
* @param int $max
945-
* @param int $xdefault
943+
* @param float $min
944+
* @param float $max
945+
* @param float $xdefault
946946
* @throws AppwriteException
947947
* @return array
948948
949949
*/
950-
public function updateFloatAttribute(string $databaseId, string $collectionId, string $key, bool $required, int $min, int $max, int $xdefault): array
950+
public function updateFloatAttribute(string $databaseId, string $collectionId, string $key, bool $required, float $min, float $max, float $xdefault): array
951951
{
952952
$apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}');
953953

src/Appwrite/Services/Storage.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -574,15 +574,15 @@ public function getFileDownload(string $bucketId, string $fileId): string
574574
* @param int $borderWidth
575575
* @param string $borderColor
576576
* @param int $borderRadius
577-
* @param int $opacity
577+
* @param float $opacity
578578
* @param int $rotation
579579
* @param string $background
580580
* @param ImageFormat $output
581581
* @throws AppwriteException
582582
* @return string
583583
584584
*/
585-
public function getFilePreview(string $bucketId, string $fileId, int $width = null, int $height = null, ImageGravity $gravity = null, int $quality = null, int $borderWidth = null, string $borderColor = null, int $borderRadius = null, int $opacity = null, int $rotation = null, string $background = null, ImageFormat $output = null): string
585+
public function getFilePreview(string $bucketId, string $fileId, int $width = null, int $height = null, ImageGravity $gravity = null, int $quality = null, int $borderWidth = null, string $borderColor = null, int $borderRadius = null, float $opacity = null, int $rotation = null, string $background = null, ImageFormat $output = null): string
586586
{
587587
$apiPath = str_replace(['{bucketId}', '{fileId}'], [$bucketId, $fileId], '/storage/buckets/{bucketId}/files/{fileId}/preview');
588588

0 commit comments

Comments
 (0)