Skip to content

Commit 28c7b0d

Browse files
committed
Update for 1.0.0
1 parent 9bcfe97 commit 28c7b0d

25 files changed

+263
-54
lines changed

README.md

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

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

@@ -43,12 +43,13 @@ Once your SDK object is set, create any of the Appwrite service objects and choo
4343
```php
4444
$users = new Users($client);
4545

46-
$result = $users->create('[email protected]', 'password');
46+
$user = $users->create(ID::unique(), '[email protected]', 'password');
4747
```
4848

4949
### Full Example
5050
```php
5151
use Appwrite\Client;
52+
use Appwrite\ID;
5253
use Appwrite\Services\Users;
5354

5455
$client = new Client();
@@ -62,7 +63,7 @@ $client
6263

6364
$users = new Users($client);
6465

65-
$result = $users->create('[USER_ID]', '[email protected]', 'password');
66+
$user = $users->create(ID::unique(), '[email protected]', 'password');
6667
```
6768

6869
### Error Handling
@@ -71,7 +72,7 @@ The Appwrite PHP SDK raises `AppwriteException` object with `message`, `code` an
7172
```php
7273
$users = new Users($client);
7374
try {
74-
$result = $users->create('[USER_ID]', '[email protected]', 'password');
75+
$user = $users->create(ID::unique(), '[email protected]', 'password');
7576
} catch(AppwriteException $error) {
7677
echo $error->message;
7778
}

docs/account.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
2525
| email | string | User email. | |
2626
| password | string | User password. Must be at least 8 chars. | |
2727

28-
## Get Account Logs
28+
## List Account Logs
2929

3030
```http request
3131
GET https://HOSTNAME/v1/account/logs
@@ -139,7 +139,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
139139
| password | string | New user password. Must be at least 8 chars. | |
140140
| passwordAgain | string | Repeat new user password. Must be at least 8 chars. | |
141141

142-
## Get Account Sessions
142+
## List Account Sessions
143143

144144
```http request
145145
GET https://HOSTNAME/v1/account/sessions

docs/examples/account/list-logs.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\Account;
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+
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
12+
;
13+
14+
$account = new Account($client);
15+
16+
$result = $account->listLogs();
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\Account;
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+
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
12+
;
13+
14+
$account = new Account($client);
15+
16+
$result = $account->listSessions();
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\Locale;
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+
$locale = new Locale($client);
15+
16+
$result = $locale->listContinents();
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\Locale;
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+
$locale = new Locale($client);
15+
16+
$result = $locale->listCountriesEU();
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\Locale;
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+
$locale = new Locale($client);
15+
16+
$result = $locale->listCountriesPhones();
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\Locale;
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+
$locale = new Locale($client);
15+
16+
$result = $locale->listCountries();
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\Locale;
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+
$locale = new Locale($client);
15+
16+
$result = $locale->listCurrencies();
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\Locale;
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+
$locale = new Locale($client);
15+
16+
$result = $locale->listLanguages();

0 commit comments

Comments
 (0)