php-docs-samples/datastore/api at master · jins-coder/php-docs-samples · GitHub
Skip to content

Latest commit

 

History

History
 
 

Folders and files

Cloud Datastore code snippets

These samples show how to use the Datastore API from PHP.

The code is using Google Cloud Client Library for PHP.

To run the tests do the following:

  1. Enable billing.
  2. Enable the Cloud Datastore API.
  3. Create a service account at the Service account section in the Cloud Console
  4. Download the json key file of the service account.
  5. Set GOOGLE_APPLICATION_CREDENTIALS environment variable pointing to that file.
  6. Install dependencies via Composer. Run php composer.phar install (if composer is installed locally) or composer install (if composer is installed globally).
  7. Create Datastore indexes by running gcloud datastore indexes create index.yaml
  8. Check the Indexes page to verify the indexes have been created.
  9. Run phpunit