Skip to content

Commit

Permalink
Further README updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Walder committed Sep 3, 2016
1 parent e019825 commit bbbf83b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,24 @@ Code: https://github.com/tomwalder/php-gds-demo

## New in Version 3.0 ##

* Support for the new Datastore API, v1 - via REST
Just one major upgrade in 3.0
* Support for the new Datastore API, v1 - via REST (gRPC to come)

### Using the Datastore REST API v1 (Sep 2016) ###

The Datastore REST API v1 went Generally Available (GA) in 2016. The previous REST API will be deprecated after September 2016.

If you are running PHP-GDS from somewhere other than App Engine, you need to use the REST API v1.

You just have to pass an instance of the RESTv1 gateway into your Store objects on construction, like this:
You just have to pass an instance of the RESTv1 gateway into your Store objects on construction.

```php
$obj_book_store = new GDS\Store('Book', new \GDS\Gateway\RESTv1(PROJECT_ID));
```

You might need to set an environment variable with the path to your JSON credentials file first, like this:
You might need to set an environment variable with the path to your JSON credentials file first.

```php
putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/credentials.json');

// A regular Store, but with a custom Gateway
$obj_book_store = new GDS\Store('Book', new \GDS\Gateway\RESTv1(PROJECT_ID));
```

You can find out more about the auth system here: [Google Auth Library for PHP](https://github.com/google/google-auth-library-php)
Expand All @@ -110,7 +110,7 @@ You can download a service account JSON file from the Google Cloud Console `API

## Changes in Version 2.0 ##

New features in 2.0 include
Features in 2.0 included
* **Faster** - use of Google Protocol Buffer allows faster, low-level access to Datastore
* **Easier to use** - sensible defaults and auto-detection for AppEngine environments
* **Less dependencies** - no need for the Google PHP API Client, unless running remote or from non-AppEngine environments
Expand Down

0 comments on commit bbbf83b

Please sign in to comment.