Skip to content

Commit

Permalink
Remove references to the GoogleAPIClient implementation. REST API v1 …
Browse files Browse the repository at this point in the history
…support coming.
  • Loading branch information
Tom Walder committed Aug 30, 2016
1 parent a3cb882 commit d6fe8a2
Show file tree
Hide file tree
Showing 18 changed files with 12 additions and 1,357 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,8 @@ This library supports namespaces, and they are be configured per `Gateway` insta

```php
// Create a store for a particular customer or 'application namespace'
$obj_client = GDS\Gateway\GoogleAPIClient::createClientFromJson('/path/to/your/service.json');
$obj_namespaced_gateway = new GDS\Gateway($obj_client, PROJECT_ID, 'customer-namespace');
$obj_namespaced_book_store = new BookStore($obj_namespaced_gateway);
$obj_gateway = new \GDS\Gateway\RESTv1('project-id', 'namespace');
$obj_store = new \GDS\Store('Book', $obj_gateway);
```

Further examples are included in the examples folder.
Expand Down Expand Up @@ -432,7 +431,7 @@ and between local and live environments.
```php
// Local and Remote Gateways
$obj_gateway_local = new \GDS\Gateway\ProtoBuf();
$obj_gateway_remote = new \GDS\Gateway\GoogleAPIClient($obj_google_client);
$obj_gateway_remote = new \GDS\Gateway\RESTv1('project-name');

// Grab some books from local
$arr_books = (new \GDS\Store('Book', $obj_gateway_local))->fetchPage(20);
Expand Down
2 changes: 0 additions & 2 deletions examples/_includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
require_once('../src/GDS/Store.php');
require_once('../src/GDS/Gateway.php');
require_once('../src/GDS/Gateway/ProtoBuf.php');
require_once('../src/GDS/Gateway/GoogleAPIClient.php');
require_once('../src/GDS/Mapper.php');
require_once('../src/GDS/Mapper/ProtoBuf.php');
require_once('../src/GDS/Mapper/ProtoBufGQLParser.php');
require_once('../src/GDS/Mapper/GoogleAPIClient.php');
require_once('../src/GDS/Exception/GQL.php');
6 changes: 0 additions & 6 deletions examples/boilerplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
// ============================================================================
// ============================================================================

// We'll need a Google_Client, use our convenience method
$obj_client = GDS\Gateway\GoogleAPIClient::createGoogleClient(GDS_APP_NAME, GDS_SERVICE_ACCOUNT_NAME, GDS_KEY_FILE_PATH);

// Gateway requires a Google_Client and Dataset ID
$obj_gateway = new GDS\Gateway\GoogleAPIClient($obj_client, GDS_DATASET_ID);

// Alternative native gateway, auto-detect dataset. Should work in dev or live AppEngine
// But not in scripts.
$obj_gateway = new GDS\Gateway\ProtoBuf();
Expand Down
2 changes: 0 additions & 2 deletions examples/config/.gitignore

This file was deleted.

10 changes: 0 additions & 10 deletions examples/config/_config.php

This file was deleted.

15 changes: 0 additions & 15 deletions examples/config/setup.php

This file was deleted.

6 changes: 2 additions & 4 deletions examples/list_create.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
* @author Tom Walder <tom@docnet.nu>
*/
require_once('../vendor/autoload.php');
require_once('config/setup.php');

// We'll need a Google_Client, use our convenience method
$obj_google_client = GDS\Gateway\GoogleAPIClient::createGoogleClient(GDS_APP_NAME, GDS_SERVICE_ACCOUNT_NAME, GDS_KEY_FILE_PATH);
$obj_gateway = new GDS\Gateway\GoogleAPIClient($obj_google_client, GDS_DATASET_ID); // Optionally, namespace
// We'll need a Gateway (for REST API usage, NOT on App Engine)
$obj_gateway = new \GDS\Gateway\RESTv1('my-app-id-here');

// Define the model on-the-fly
$obj_contact_schema = (new GDS\Schema('Contact'))
Expand Down
6 changes: 1 addition & 5 deletions examples/list_fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@
require_once('../vendor/autoload.php');
require_once('config/setup.php');

// We'll need a Google_Client, use our convenience method
$obj_google_client = GDS\Gateway\GoogleAPIClient::createGoogleClient(GDS_APP_NAME, GDS_SERVICE_ACCOUNT_NAME, GDS_KEY_FILE_PATH);
$obj_gateway = new GDS\Gateway\GoogleAPIClient($obj_google_client, GDS_DATASET_ID); // Optionally, namespace

// Define the model on-the-fly
$obj_contact_schema = (new GDS\Schema('Contact'))
->addString('first_name')
->addString('last_name')
->addStringList('tags', TRUE);

// Configure the Store
$obj_store = new GDS\Store($obj_contact_schema, $obj_gateway);
$obj_store = new GDS\Store($obj_contact_schema);

// A couple of tests
show($obj_store->fetchAll("SELECT * FROM Contact_v1 WHERE tags = 'newsletter' AND tags = 'customer'"));
Expand Down
9 changes: 1 addition & 8 deletions examples/simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,9 @@
* @author Tom Walder <tom@docnet.nu>
*/
require_once('../vendor/autoload.php');
require_once('config/setup.php');

// We'll need a Google_Client, use our convenience method
$obj_client = GDS\Gateway\GoogleAPIClient::createGoogleClient(GDS_APP_NAME, GDS_SERVICE_ACCOUNT_NAME, GDS_KEY_FILE_PATH);

// Gateway requires a Google_Client and Dataset ID
$obj_gateway = new GDS\Gateway\GoogleAPIClient($obj_client, GDS_DATASET_ID);

// Store requires a Gateway and Kind
$obj_book_store = new GDS\Store('Book', $obj_gateway);
$obj_book_store = new GDS\Store('Book');

// Fetch a record
$obj_book = $obj_book_store->fetchOne();
Expand Down
3 changes: 1 addition & 2 deletions examples/simple/create_many.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

// Alternative Gateway (remote JSON API)
// Download your service JSON file from the Google Developer Console
// $obj_client = \GDS\Gateway\GoogleAPIClient::createClientFromJson('/path/to/your/service.json');
// $obj_gateway = new \GDS\Gateway\GoogleAPIClient($obj_client, 'your-app-id');
// $obj_gateway = new \GDS\Gateway\RESTv1('your-app-id');
// $obj_store = new \GDS\Store('Book', $obj_gateway);

// Create some Entity objects
Expand Down
3 changes: 1 addition & 2 deletions examples/simple/create_one.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

// Alternative Gateway (remote JSON API)
// Download your service JSON file from the Google Developer Console
// $obj_client = \GDS\Gateway\GoogleAPIClient::createClientFromJson('/path/to/your/service.json');
// $obj_gateway = new \GDS\Gateway\GoogleAPIClient($obj_client, 'your-app-id');
// $obj_gateway = new \GDS\Gateway\RESTv1('your-app-id');
// $obj_store = new \GDS\Store('Book', $obj_gateway);

// Create a simple Entity object
Expand Down
3 changes: 1 addition & 2 deletions examples/simple/create_one_array_syntax.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

// Alternative Gateway (remote JSON API)
// Download your service JSON file from the Google Developer Console
// $obj_client = \GDS\Gateway\GoogleAPIClient::createClientFromJson('/path/to/your/service.json');
// $obj_gateway = new \GDS\Gateway\GoogleAPIClient($obj_client, 'your-app-id');
// $obj_gateway = new \GDS\Gateway\RESTv1('your-app-id');
// $obj_store = new \GDS\Store('Book', $obj_gateway);

// Create a simple Entity object
Expand Down
Loading

0 comments on commit d6fe8a2

Please sign in to comment.