Skip to content

Commit 0932ca4

Browse files
implement realtime feature
1 parent 981134a commit 0932ca4

File tree

18 files changed

+217
-25
lines changed

18 files changed

+217
-25
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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-0.9.0-blue.svg?style=flat-square&v=1)
4+
![Version](https://img.shields.io/badge/api%20version-0.10.0-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_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
88

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

1111
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)
1212

@@ -79,7 +79,7 @@ try {
7979
```
8080

8181
### Learn more
82-
You can use following resources to learn more and get help
82+
You can use the following resources to learn more and get help
8383
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
8484
- 📜 [Appwrite Docs](https://appwrite.io/docs)
8585
- 💬 [Discord Community](https://appwrite.io/discord)

docs/account.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ POST https://appwrite.io/v1/account/recovery
106106
| email | string | User email. | |
107107
| url | string | URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project 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. | |
108108

109-
## Complete Password Recovery
109+
## Create Password Recovery (confirmation)
110110

111111
```http request
112112
PUT https://appwrite.io/v1/account/recovery
@@ -186,7 +186,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
186186
| --- | --- | --- | --- |
187187
| url | string | URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project 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. | |
188188

189-
## Complete Email Verification
189+
## Create Email Verification (confirmation)
190190

191191
```http request
192192
PUT https://appwrite.io/v1/account/verification

docs/examples/functions/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ $client
1313

1414
$functions = new Functions($client);
1515

16-
$result = $functions->create('[NAME]', [], 'java-11.0');
16+
$result = $functions->create('[NAME]', [], 'dotnet-5.0');

docs/examples/users/update-email.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
use Appwrite\Client;
4+
use Appwrite\Services\Users;
5+
6+
$client = new Client();
7+
8+
$client
9+
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
10+
->setProject('5df5acd0d48c2') // Your project ID
11+
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
12+
;
13+
14+
$users = new Users($client);
15+
16+
$result = $users->updateEmail('[USER_ID]', '[email protected]');

docs/examples/users/update-name.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
use Appwrite\Client;
4+
use Appwrite\Services\Users;
5+
6+
$client = new Client();
7+
8+
$client
9+
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
10+
->setProject('5df5acd0d48c2') // Your project ID
11+
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
12+
;
13+
14+
$users = new Users($client);
15+
16+
$result = $users->updateName('[USER_ID]', '[NAME]');
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
use Appwrite\Client;
4+
use Appwrite\Services\Users;
5+
6+
$client = new Client();
7+
8+
$client
9+
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
10+
->setProject('5df5acd0d48c2') // Your project ID
11+
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
12+
;
13+
14+
$users = new Users($client);
15+
16+
$result = $users->updatePassword('[USER_ID]', 'password');

docs/teams.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ GET https://appwrite.io/v1/teams/{teamId}/memberships
9999
POST https://appwrite.io/v1/teams/{teamId}/memberships
100100
```
101101

102-
** Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn&#039;t exist in the project it will be created automatically.
102+
** Use this endpoint to invite a new member to join your team. If initiated from Client SDK, an email with a link to join the team will be sent to the new member&#039;s email address if the member doesn&#039;t exist in the project it will be created automatically. If initiated from server side SDKs, new member will automatically be added to the team.
103103

104-
Use the &#039;URL&#039; parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
104+
Use the &#039;URL&#039; parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team. While calling from side SDKs the redirect url can be empty string.
105105

106106
Please note that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL&#039;s are the once from domains you have set when added your platforms in the console interface. **
107107

docs/users.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ DELETE https://appwrite.io/v1/users/{userId}
6161
| --- | --- | --- | --- |
6262
| userId | string | **Required** User unique ID. | |
6363

64+
## Update Email
65+
66+
```http request
67+
PATCH https://appwrite.io/v1/users/{userId}/email
68+
```
69+
70+
** Update the user email by its unique ID. **
71+
72+
### Parameters
73+
74+
| Field Name | Type | Description | Default |
75+
| --- | --- | --- | --- |
76+
| userId | string | **Required** User unique ID. | |
77+
| email | string | User email. | |
78+
6479
## Get User Logs
6580

6681
```http request
@@ -75,6 +90,36 @@ GET https://appwrite.io/v1/users/{userId}/logs
7590
| --- | --- | --- | --- |
7691
| userId | string | **Required** User unique ID. | |
7792

93+
## Update Name
94+
95+
```http request
96+
PATCH https://appwrite.io/v1/users/{userId}/name
97+
```
98+
99+
** Update the user name by its unique ID. **
100+
101+
### Parameters
102+
103+
| Field Name | Type | Description | Default |
104+
| --- | --- | --- | --- |
105+
| userId | string | **Required** User unique ID. | |
106+
| name | string | User name. Max length: 128 chars. | |
107+
108+
## Update Password
109+
110+
```http request
111+
PATCH https://appwrite.io/v1/users/{userId}/password
112+
```
113+
114+
** Update the user password by its unique ID. **
115+
116+
### Parameters
117+
118+
| Field Name | Type | Description | Default |
119+
| --- | --- | --- | --- |
120+
| userId | string | **Required** User unique ID. | |
121+
| password | string | New user password. Must be between 6 to 32 chars. | |
122+
78123
## Get User Preferences
79124

80125
```http request

src/Appwrite/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ class Client
3535
*/
3636
protected $headers = [
3737
'content-type' => '',
38-
'x-sdk-version' => 'appwrite:php:2.2.0',
38+
'x-sdk-version' => 'appwrite:php:2.3.0',
3939
];
4040

4141
/**
4242
* SDK constructor.
4343
*/
4444
public function __construct()
4545
{
46-
$this->headers['X-Appwrite-Response-Format'] = '0.9.0';
46+
$this->headers['X-Appwrite-Response-Format'] = '0.10.0';
4747

4848
}
4949

src/Appwrite/Services/Account.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public function createRecovery(string $email, string $url): array
259259
}
260260

261261
/**
262-
* Complete Password Recovery
262+
* Create Password Recovery (confirmation)
263263
*
264264
* Use this endpoint to complete the user account password reset. Both the
265265
* **userId** and **secret** arguments will be passed as query parameters to
@@ -449,7 +449,7 @@ public function createVerification(string $url): array
449449
}
450450

451451
/**
452-
* Complete Email Verification
452+
* Create Email Verification (confirmation)
453453
*
454454
* Use this endpoint to complete the user email verification process. Use both
455455
* the **userId** and **secret** parameters that were attached to your app URL
@@ -486,4 +486,4 @@ public function updateVerification(string $userId, string $secret): array
486486
'content-type' => 'application/json',
487487
], $params);
488488
}
489-
}
489+
}

src/Appwrite/Services/Avatars.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,4 +292,4 @@ public function getQR(string $text, int $size = null, int $margin = null, bool $
292292
'content-type' => 'application/json',
293293
], $params);
294294
}
295-
}
295+
}

src/Appwrite/Services/Database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,4 +425,4 @@ public function deleteDocument(string $collectionId, string $documentId): array
425425
'content-type' => 'application/json',
426426
], $params);
427427
}
428-
}
428+
}

src/Appwrite/Services/Functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,4 +509,4 @@ public function deleteTag(string $functionId, string $tagId): array
509509
'content-type' => 'application/json',
510510
], $params);
511511
}
512-
}
512+
}

src/Appwrite/Services/Health.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,4 @@ public function getTime(): array
234234
'content-type' => 'application/json',
235235
], $params);
236236
}
237-
}
237+
}

src/Appwrite/Services/Locale.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,4 @@ public function getLanguages(): array
145145
'content-type' => 'application/json',
146146
], $params);
147147
}
148-
}
148+
}

src/Appwrite/Services/Storage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,4 +307,4 @@ public function getFileView(string $fileId): string
307307
'content-type' => 'application/json',
308308
], $params);
309309
}
310-
}
310+
}

src/Appwrite/Services/Teams.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,17 @@ public function getMemberships(string $teamId, string $search = null, int $limit
212212
/**
213213
* Create Team Membership
214214
*
215-
* Use this endpoint to invite a new member to join your team. An email with a
216-
* link to join the team will be sent to the new member email address if the
217-
* member doesn't exist in the project it will be created automatically.
215+
* Use this endpoint to invite a new member to join your team. If initiated
216+
* from Client SDK, an email with a link to join the team will be sent to the
217+
* new member's email address if the member doesn't exist in the project it
218+
* will be created automatically. If initiated from server side SDKs, new
219+
* member will automatically be added to the team.
218220
*
219221
* Use the 'URL' parameter to redirect the user from the invitation email back
220222
* to your app. When the user is redirected, use the [Update Team Membership
221223
* Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow
222-
* the user to accept the invitation to the team.
224+
* the user to accept the invitation to the team. While calling from side
225+
* SDKs the redirect url can be empty string.
223226
*
224227
* Please note that in order to avoid a [Redirect
225228
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
@@ -388,4 +391,4 @@ public function updateMembershipStatus(string $teamId, string $membershipId, str
388391
'content-type' => 'application/json',
389392
], $params);
390393
}
391-
}
394+
}

0 commit comments

Comments
 (0)