Skip to content

Commit 4e205ea

Browse files
authored
Merge pull request #58 from appwrite/dev
2 parents 8738e81 + 4508b2b commit 4e205ea

80 files changed

Lines changed: 3437 additions & 954 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vendor/
2+
composer.lock

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## 20.0.0
4+
5+
* Add array-based enum parameters (e.g., `permissions: array<BrowserPermission>`).
6+
* Breaking change: `Output` enum has been removed; use `ImageFormat` instead.
7+
* Add `getQueueAudits` support to `Health` service.
8+
* Add longtext/mediumtext/text/varchar attribute and column helpers to `Databases` and `TablesDB` services.
9+
310
## 19.1.0
411

512
* Added ability to create columns and indexes synchronously while creating a table
@@ -41,4 +48,4 @@
4148
* Add `dart38` and `flutter332` support to runtime models
4249
* Add `gif` support to `ImageFormat` enum
4350
* Add `upsertDocument` support to `Databases` service
44-
* Add `sequence` support to `Document` model
51+
* Add `sequence` support to `Document` model

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors.
1+
Copyright (c) 2026 Appwrite (https://appwrite.io) and individual contributors.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
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.8.0-blue.svg?style=flat-square&v=1)
4+
![Version](https://img.shields.io/badge/api%20version-1.8.1-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)
88

99
**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**
1010

11-
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the PHP SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
11+
Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the PHP SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1212

1313
![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png)
1414

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "appwrite/appwrite",
3-
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
3+
"description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
44
"type": "library",
55
"license": "BSD-3-Clause",
66
"support": {
@@ -16,13 +16,13 @@
1616
}
1717
},
1818
"require": {
19-
"php": ">=7.1.0",
19+
"php": ">=8.0.0",
2020
"ext-curl": "*",
2121
"ext-json": "*"
2222
},
2323
"require-dev": {
2424
"phpunit/phpunit": "^10",
25-
"mockery/mockery": "^1.6.12"
25+
"mockery/mockery": "1.6.12"
2626
},
2727
"minimum-stability": "dev"
2828
}

docs/account.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ POST https://cloud.appwrite.io/v1/account/jwts
7373

7474
** Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. **
7575

76+
### Parameters
77+
78+
| Field Name | Type | Description | Default |
79+
| --- | --- | --- | --- |
80+
| duration | integer | Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. | 900 |
81+
7682

7783
```http request
7884
GET https://cloud.appwrite.io/v1/account/logs

docs/databases.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,82 @@ PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectio
560560
| newKey | string | New attribute key. | |
561561

562562

563+
```http request
564+
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/longtext
565+
```
566+
567+
** Create a longtext attribute.
568+
**
569+
570+
### Parameters
571+
572+
| Field Name | Type | Description | Default |
573+
| --- | --- | --- | --- |
574+
| databaseId | string | **Required** Database ID. | |
575+
| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
576+
| key | string | Attribute Key. | |
577+
| required | boolean | Is attribute required? | |
578+
| default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
579+
| array | boolean | Is attribute an array? | |
580+
581+
582+
```http request
583+
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/longtext/{key}
584+
```
585+
586+
** Update a longtext attribute. Changing the `default` value will not update already existing documents.
587+
**
588+
589+
### Parameters
590+
591+
| Field Name | Type | Description | Default |
592+
| --- | --- | --- | --- |
593+
| databaseId | string | **Required** Database ID. | |
594+
| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
595+
| key | string | **Required** Attribute Key. | |
596+
| required | boolean | Is attribute required? | |
597+
| default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
598+
| newKey | string | New Attribute Key. | |
599+
600+
601+
```http request
602+
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext
603+
```
604+
605+
** Create a mediumtext attribute.
606+
**
607+
608+
### Parameters
609+
610+
| Field Name | Type | Description | Default |
611+
| --- | --- | --- | --- |
612+
| databaseId | string | **Required** Database ID. | |
613+
| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
614+
| key | string | Attribute Key. | |
615+
| required | boolean | Is attribute required? | |
616+
| default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
617+
| array | boolean | Is attribute an array? | |
618+
619+
620+
```http request
621+
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext/{key}
622+
```
623+
624+
** Update a mediumtext attribute. Changing the `default` value will not update already existing documents.
625+
**
626+
627+
### Parameters
628+
629+
| Field Name | Type | Description | Default |
630+
| --- | --- | --- | --- |
631+
| databaseId | string | **Required** Database ID. | |
632+
| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
633+
| key | string | **Required** Attribute Key. | |
634+
| required | boolean | Is attribute required? | |
635+
| default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
636+
| newKey | string | New Attribute Key. | |
637+
638+
563639
```http request
564640
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/point
565641
```
@@ -692,6 +768,44 @@ PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectio
692768
| newKey | string | New Attribute Key. | |
693769

694770

771+
```http request
772+
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/text
773+
```
774+
775+
** Create a text attribute.
776+
**
777+
778+
### Parameters
779+
780+
| Field Name | Type | Description | Default |
781+
| --- | --- | --- | --- |
782+
| databaseId | string | **Required** Database ID. | |
783+
| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
784+
| key | string | Attribute Key. | |
785+
| required | boolean | Is attribute required? | |
786+
| default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
787+
| array | boolean | Is attribute an array? | |
788+
789+
790+
```http request
791+
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/text/{key}
792+
```
793+
794+
** Update a text attribute. Changing the `default` value will not update already existing documents.
795+
**
796+
797+
### Parameters
798+
799+
| Field Name | Type | Description | Default |
800+
| --- | --- | --- | --- |
801+
| databaseId | string | **Required** Database ID. | |
802+
| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
803+
| key | string | **Required** Attribute Key. | |
804+
| required | boolean | Is attribute required? | |
805+
| default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
806+
| newKey | string | New Attribute Key. | |
807+
808+
695809
```http request
696810
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/url
697811
```
@@ -730,6 +844,46 @@ PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectio
730844
| newKey | string | New Attribute Key. | |
731845

732846

847+
```http request
848+
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/varchar
849+
```
850+
851+
** Create a varchar attribute.
852+
**
853+
854+
### Parameters
855+
856+
| Field Name | Type | Description | Default |
857+
| --- | --- | --- | --- |
858+
| databaseId | string | **Required** Database ID. | |
859+
| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
860+
| key | string | Attribute Key. | |
861+
| size | integer | Attribute size for varchar attributes, in number of characters. Maximum size is 16381. | |
862+
| required | boolean | Is attribute required? | |
863+
| default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
864+
| array | boolean | Is attribute an array? | |
865+
866+
867+
```http request
868+
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/varchar/{key}
869+
```
870+
871+
** Update a varchar attribute. Changing the `default` value will not update already existing documents.
872+
**
873+
874+
### Parameters
875+
876+
| Field Name | Type | Description | Default |
877+
| --- | --- | --- | --- |
878+
| databaseId | string | **Required** Database ID. | |
879+
| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
880+
| key | string | **Required** Attribute Key. | |
881+
| required | boolean | Is attribute required? | |
882+
| default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
883+
| size | integer | Maximum size of the varchar attribute. | |
884+
| newKey | string | New Attribute Key. | |
885+
886+
733887
```http request
734888
GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/{key}
735889
```

docs/examples/account/create-jwt.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ $client = (new Client())
1010

1111
$account = new Account($client);
1212

13-
$result = $account->createJWT();
13+
$result = $account->createJWT(
14+
duration: 0 // optional
15+
);

docs/examples/avatars/get-screenshot.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use Appwrite\Client;
44
use Appwrite\Services\Avatars;
55
use Appwrite\Enums\Theme;
66
use Appwrite\Enums\Timezone;
7-
use Appwrite\Enums\Output;
7+
use Appwrite\Enums\BrowserPermission;
8+
use Appwrite\Enums\ImageFormat;
89
910
$client = (new Client())
1011
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -22,19 +23,19 @@ $result = $avatars->getScreenshot(
2223
viewportWidth: 1920, // optional
2324
viewportHeight: 1080, // optional
2425
scale: 2, // optional
25-
theme: Theme::LIGHT(), // optional
26+
theme: Theme::DARK(), // optional
2627
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional
2728
fullpage: true, // optional
2829
locale: 'en-US', // optional
29-
timezone: Timezone::AFRICAABIDJAN(), // optional
30+
timezone: Timezone::AMERICANEWYORK(), // optional
3031
latitude: 37.7749, // optional
3132
longitude: -122.4194, // optional
3233
accuracy: 100, // optional
3334
touch: true, // optional
34-
permissions: ["geolocation","notifications"], // optional
35+
permissions: [BrowserPermission::GEOLOCATION(), BrowserPermission::NOTIFICATIONS()], // optional
3536
sleep: 3, // optional
3637
width: 800, // optional
3738
height: 600, // optional
3839
quality: 85, // optional
39-
output: Output::JPG() // optional
40+
output: ImageFormat::JPEG() // optional
4041
);

docs/examples/databases/create-index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use Appwrite\Client;
44
use Appwrite\Services\Databases;
55
use Appwrite\Enums\IndexType;
6+
use Appwrite\Enums\OrderBy;
67
78
$client = (new Client())
89
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -17,6 +18,6 @@ $result = $databases->createIndex(
1718
key: '',
1819
type: IndexType::KEY(),
1920
attributes: [],
20-
orders: [], // optional
21+
orders: [OrderBy::ASC()], // optional
2122
lengths: [] // optional
2223
);

0 commit comments

Comments
 (0)