php-docs-samples/datastore/tutorial at master · bashcarpenter/php-docs-samples · GitHub
Skip to content

Latest commit

 

History

History
 
 

Folders and files

Cloud Datastore sample application

This code sample is intended to be in the following document: https://cloud.google.com/datastore/docs/datastore-api-tutorial

The code is using Google Cloud Client Library for PHP.

To run the sample, do the following first:

  1. Enable billing.
  2. Enable the Cloud Datastore API.
  3. Install dependencies via Composer. Run php composer.phar install (if composer is installed locally) or composer install (if composer is installed globally).

Then use one of the following methods:

  1. Run gcloud auth application-default login

or

  1. Create a service account at the Service account section in the Cloud Console
  2. Download the json key file of the service account.
  3. Set GOOGLE_APPLICATION_CREDENTIALS environment variable pointing to that file.

Then you can run the command: php tasks.php