Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

## 21.0.0

* Breaking: Updated createDeployment signature and relationship attribute endpoint path
* Added TTL parameter support to listDocuments and listRows
* Added getConsolePausing health endpoint to Health service
* [BREAKING] Changed `$sequence` type from `int` to `string` for rows and documents
* [BREAKING] Renamed `IndexType` enum: split into `DatabasesIndexType` (for Databases) and `TablesDBIndexType` (for TablesDB)
* [BREAKING] Replaced `specification` parameter with `buildSpecification` and `runtimeSpecification` in `Functions::create()`, `Functions::update()`, `Sites::create()`, `Sites::update()`
* Added new `Project` service with full CRUD for project-level environment variables
* Added new `Webhooks` service with full CRUD for project webhooks (including `updateSignature`)
* Added `Users::updateImpersonator()` method for enabling/disabling user impersonation
* Added impersonation support: `setImpersonateUserId()`, `setImpersonateUserEmail()`, `setImpersonateUserPhone()` on `Client`
* Added `deploymentRetention` parameter to Functions and Sites create/update
* Added `startCommand` parameter to Sites create/update
* Added `Documentsdb`, `Vectorsdb` values to `BackupServices` and `DatabaseType` enums
* Added `WebhooksRead`, `WebhooksWrite`, `ProjectRead`, `ProjectWrite` scopes
* Removed `getQueueBillingProjectAggregation`, `getQueueBillingTeamAggregation`, `getQueuePriorityBuilds`, `getQueueRegionManager`, `getQueueThreats` from `Health` service
* Updated `Log` model field descriptions to clarify impersonation behavior
* Updated `X-Appwrite-Response-Format` header to `1.9.0`

## 20.2.0

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Appwrite PHP SDK

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

**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).**
**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**

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)

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/create-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use Appwrite\Client;
use Appwrite\Services\Databases;
use Appwrite\Enums\IndexType;
use Appwrite\Enums\DatabasesIndexType;
use Appwrite\Enums\OrderBy;

$client = (new Client())
Expand All @@ -17,7 +17,7 @@ $result = $databases->createIndex(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
type: IndexType::KEY(),
type: DatabasesIndexType::KEY(),
attributes: [],
orders: [OrderBy::ASC()], // optional
lengths: [] // optional
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ $result = $functions->create(
providerBranch: '<PROVIDER_BRANCH>', // optional
providerSilentMode: false, // optional
providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional
specification: '' // optional
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
);```
4 changes: 3 additions & 1 deletion docs/examples/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ $result = $functions->update(
providerBranch: '<PROVIDER_BRANCH>', // optional
providerSilentMode: false, // optional
providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional
specification: '' // optional
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
);```
19 changes: 19 additions & 0 deletions docs/examples/project/create-variable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Project;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key

$project = new Project($client);

$result = $project->createVariable(
variableId: '<VARIABLE_ID>',
key: '<KEY>',
value: '<VALUE>',
secret: false // optional
);```
16 changes: 16 additions & 0 deletions docs/examples/project/delete-variable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Project;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key

$project = new Project($client);

$result = $project->deleteVariable(
variableId: '<VARIABLE_ID>'
);```
16 changes: 16 additions & 0 deletions docs/examples/project/get-variable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Project;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key

$project = new Project($client);

$result = $project->getVariable(
variableId: '<VARIABLE_ID>'
);```
17 changes: 17 additions & 0 deletions docs/examples/project/list-variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Project;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key

$project = new Project($client);

$result = $project->listVariables(
queries: [], // optional
total: false // optional
);```
19 changes: 19 additions & 0 deletions docs/examples/project/update-variable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Project;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key

$project = new Project($client);

$result = $project->updateVariable(
variableId: '<VARIABLE_ID>',
key: '<KEY>', // optional
value: '<VALUE>', // optional
secret: false // optional
);```
5 changes: 4 additions & 1 deletion docs/examples/sites/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ $result = $sites->create(
timeout: 1, // optional
installCommand: '<INSTALL_COMMAND>', // optional
buildCommand: '<BUILD_COMMAND>', // optional
startCommand: '<START_COMMAND>', // optional
outputDirectory: '<OUTPUT_DIRECTORY>', // optional
adapter: Adapter::STATIC(), // optional
installationId: '<INSTALLATION_ID>', // optional
Expand All @@ -32,5 +33,7 @@ $result = $sites->create(
providerBranch: '<PROVIDER_BRANCH>', // optional
providerSilentMode: false, // optional
providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional
specification: '' // optional
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
);```
5 changes: 4 additions & 1 deletion docs/examples/sites/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ $result = $sites->update(
timeout: 1, // optional
installCommand: '<INSTALL_COMMAND>', // optional
buildCommand: '<BUILD_COMMAND>', // optional
startCommand: '<START_COMMAND>', // optional
outputDirectory: '<OUTPUT_DIRECTORY>', // optional
buildRuntime: BuildRuntime::NODE145(), // optional
adapter: Adapter::STATIC(), // optional
Expand All @@ -32,5 +33,7 @@ $result = $sites->update(
providerBranch: '<PROVIDER_BRANCH>', // optional
providerSilentMode: false, // optional
providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional
specification: '' // optional
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
);```
4 changes: 2 additions & 2 deletions docs/examples/tablesdb/create-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use Appwrite\Client;
use Appwrite\Services\TablesDB;
use Appwrite\Enums\IndexType;
use Appwrite\Enums\TablesDBIndexType;
use Appwrite\Enums\OrderBy;

$client = (new Client())
Expand All @@ -17,7 +17,7 @@ $result = $tablesDB->createIndex(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
type: IndexType::KEY(),
type: TablesDBIndexType::KEY(),
columns: [],
orders: [OrderBy::ASC()], // optional
lengths: [] // optional
Expand Down
17 changes: 17 additions & 0 deletions docs/examples/users/update-impersonator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Users;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key

$users = new Users($client);

$result = $users->updateImpersonator(
userId: '<USER_ID>',
impersonator: false
);```
23 changes: 23 additions & 0 deletions docs/examples/webhooks/create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Webhooks;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key

$webhooks = new Webhooks($client);

$result = $webhooks->create(
webhookId: '<WEBHOOK_ID>',
url: '',
name: '<NAME>',
events: [],
enabled: false, // optional
security: false, // optional
httpUser: '<HTTP_USER>', // optional
httpPass: '<HTTP_PASS>' // optional
);```
16 changes: 16 additions & 0 deletions docs/examples/webhooks/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Webhooks;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key

$webhooks = new Webhooks($client);

$result = $webhooks->delete(
webhookId: '<WEBHOOK_ID>'
);```
16 changes: 16 additions & 0 deletions docs/examples/webhooks/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Webhooks;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key

$webhooks = new Webhooks($client);

$result = $webhooks->get(
webhookId: '<WEBHOOK_ID>'
);```
17 changes: 17 additions & 0 deletions docs/examples/webhooks/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Webhooks;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key

$webhooks = new Webhooks($client);

$result = $webhooks->list(
queries: [], // optional
total: false // optional
);```
16 changes: 16 additions & 0 deletions docs/examples/webhooks/update-signature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Webhooks;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key

$webhooks = new Webhooks($client);

$result = $webhooks->updateSignature(
webhookId: '<WEBHOOK_ID>'
);```
23 changes: 23 additions & 0 deletions docs/examples/webhooks/update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Webhooks;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key

$webhooks = new Webhooks($client);

$result = $webhooks->update(
webhookId: '<WEBHOOK_ID>',
name: '<NAME>',
url: '',
events: [],
enabled: false, // optional
security: false, // optional
httpUser: '<HTTP_USER>', // optional
httpPass: '<HTTP_PASS>' // optional
);```
8 changes: 6 additions & 2 deletions docs/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ POST https://cloud.appwrite.io/v1/functions
| providerBranch | string | Production branch for the repo linked to the function. | |
| providerSilentMode | boolean | Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. | |
| providerRootDirectory | string | Path to function code in the linked repo. | |
| specification | string | Runtime specification for the function and builds. | [] |
| buildSpecification | string | Build specification for the function deployments. | [] |
| runtimeSpecification | string | Runtime specification for the function executions. | [] |
| deploymentRetention | integer | Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. | 0 |


```http request
Expand Down Expand Up @@ -100,7 +102,9 @@ PUT https://cloud.appwrite.io/v1/functions/{functionId}
| providerBranch | string | Production branch for the repo linked to the function | |
| providerSilentMode | boolean | Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. | |
| providerRootDirectory | string | Path to function code in the linked repo. | |
| specification | string | Runtime specification for the function and builds. | [] |
| buildSpecification | string | Build specification for the function deployments. | [] |
| runtimeSpecification | string | Runtime specification for the function executions. | [] |
| deploymentRetention | integer | Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. | 0 |


```http request
Expand Down
Loading