Skip to content

Commit d22b361

Browse files
authored
Merge pull request #66 from appwrite/dev
feat: PHP SDK update for version 23.0.0
2 parents 38546dd + 0de359a commit d22b361

219 files changed

Lines changed: 14590 additions & 3043 deletions

File tree

Some content is hidden

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

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Change Log
22

3+
## 23.0.0
4+
5+
* [BREAKING] Renamed Webhook model fields: `security``tls`, `httpUser``authUsername`, `httpPass``authPassword`, `signatureKey``secret`
6+
* [BREAKING] Renamed Webhook service parameters to match: `security``tls`, `httpUser``authUsername`, `httpPass``authPassword`
7+
* [BREAKING] Renamed `Webhooks::updateSignature()` to `Webhooks::updateSecret()` with new optional `secret` parameter
8+
* Added `from(array)` static factory method and `toArray()` serializer to all response models with required-field validation
9+
* Added `secret` parameter to Webhook create and update methods
10+
* Added `x` OAuth provider to `OAuthProvider` enum
11+
* Added `userType` field to `Log` model
12+
* Added `purge` parameter to `updateCollection` and `updateTable` for cache invalidation
13+
* Added Project service: platform CRUD, key CRUD, protocol/service status management
14+
* Added new models: `Key`, `KeyList`, `Project`, `DevKey`, `MockNumber`, `AuthProvider`, `PlatformAndroid`, `PlatformApple`, `PlatformLinux`, `PlatformList`, `PlatformWeb`, `PlatformWindows`, `BillingLimits`, `Block`
15+
* Added new enums: `PlatformType`, `ProtocolId`, `ServiceId`
16+
* Updated `BuildRuntime`, `Runtime` enums with `dart-3.11` and `flutter-3.41`
17+
* Updated `Scopes` enum with `keysRead`, `keysWrite`, `platformsRead`, `platformsWrite`
18+
* Updated `X-Appwrite-Response-Format` header to `1.9.1`
19+
* Updated TTL description for list caching in Databases and TablesDB
20+
* Replaced internal `FIELD_MAP`/`ARRAY_TYPES` constants and `parseResponse()` with explicit `Model::from()` hydration
21+
322
## 22.0.0
423

524
* [BREAKING] Raised minimum PHP version from 8.0 to 8.2

README.md

Lines changed: 1 addition & 1 deletion
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.9.0-blue.svg?style=flat-square&v=1)
4+
![Version](https://img.shields.io/badge/api%20version-1.9.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)

docs/account.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
565565

566566
| Field Name | Type | Description | Default |
567567
| --- | --- | --- | --- |
568-
| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. | |
568+
| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. | |
569569
| success | string | URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | |
570570
| failure | string | URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | |
571571
| scopes | array | A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. | [] |

docs/databases.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ PUT https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionI
220220
| permissions | array | An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). | |
221221
| documentSecurity | boolean | Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). | |
222222
| enabled | boolean | Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. | 1 |
223+
| purge | boolean | When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. | |
223224

224225

225226
```http request
@@ -951,7 +952,7 @@ GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionI
951952
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] |
952953
| transactionId | string | Transaction ID to read uncommitted changes within the transaction. | |
953954
| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 |
954-
| ttl | integer | TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). | 0 |
955+
| ttl | integer | TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). | 0 |
955956

956957

957958
```http request

docs/examples/databases/update-collection.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ $result = $databases->updateCollection(
1919
name: '<NAME>', // optional
2020
permissions: [Permission::read(Role::any())], // optional
2121
documentSecurity: false, // optional
22-
enabled: false // optional
22+
enabled: false, // optional
23+
purge: false // optional
2324
);```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Project;
6+
7+
$client = (new Client())
8+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
9+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
10+
->setKey('<YOUR_API_KEY>'); // Your secret API key
11+
12+
$project = new Project($client);
13+
14+
$result = $project->createAndroidPlatform(
15+
platformId: '<PLATFORM_ID>',
16+
name: '<NAME>',
17+
applicationId: '<APPLICATION_ID>'
18+
);```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Project;
6+
7+
$client = (new Client())
8+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
9+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
10+
->setKey('<YOUR_API_KEY>'); // Your secret API key
11+
12+
$project = new Project($client);
13+
14+
$result = $project->createApplePlatform(
15+
platformId: '<PLATFORM_ID>',
16+
name: '<NAME>',
17+
bundleIdentifier: '<BUNDLE_IDENTIFIER>'
18+
);```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Project;
6+
use Appwrite\Enums\Scopes;
7+
8+
$client = (new Client())
9+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
10+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
11+
->setKey('<YOUR_API_KEY>'); // Your secret API key
12+
13+
$project = new Project($client);
14+
15+
$result = $project->createKey(
16+
keyId: '<KEY_ID>',
17+
name: '<NAME>',
18+
scopes: [Scopes::SESSIONSWRITE()],
19+
expire: '2020-10-15T06:38:00.000+00:00' // optional
20+
);```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Project;
6+
7+
$client = (new Client())
8+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
9+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
10+
->setKey('<YOUR_API_KEY>'); // Your secret API key
11+
12+
$project = new Project($client);
13+
14+
$result = $project->createLinuxPlatform(
15+
platformId: '<PLATFORM_ID>',
16+
name: '<NAME>',
17+
packageName: '<PACKAGE_NAME>'
18+
);```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Project;
6+
7+
$client = (new Client())
8+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
9+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
10+
->setKey('<YOUR_API_KEY>'); // Your secret API key
11+
12+
$project = new Project($client);
13+
14+
$result = $project->createWebPlatform(
15+
platformId: '<PLATFORM_ID>',
16+
name: '<NAME>',
17+
hostname: 'app.example.com'
18+
);```

0 commit comments

Comments
 (0)