用于Google云数据存储的PHP API

用于Google云数据存储的PHP API,php,google-app-engine,google-cloud-datastore,google-cloud-platform,Php,Google App Engine,Google Cloud Datastore,Google Cloud Platform,我一直找不到Google Can数据存储的PHP API的任何文档。我正在尝试将NoSQL MongoDB数据库网站迁移到Google App Engine,而云数据存储似乎是目前最好的选择。我能找到的唯一文档是Node.js、Python和Java 我在这里有一个库:也可以从packagist获得datachore/datachore。来自谷歌的现在是GA 您可以使用Composer安装它: composer require google/cloud 然后,使用它就像包含它一样简单,初始化项

我一直找不到Google Can数据存储的PHP API的任何文档。我正在尝试将NoSQL MongoDB数据库网站迁移到Google App Engine,而云数据存储似乎是目前最好的选择。我能找到的唯一文档是Node.js、Python和Java


我在这里有一个库:也可以从packagist获得datachore/datachore。

来自谷歌的现在是GA

您可以使用Composer安装它:

composer require google/cloud
然后,使用它就像包含它一样简单,初始化项目的客户端,然后执行操作:

# Includes the autoloader for libraries installed with composer
require __DIR__ . '/vendor/autoload.php';

# Imports the Google Cloud client library
use Google\Cloud\Datastore\DatastoreClient;

# Your Google Cloud Platform project ID
$projectId = 'YOUR_PROJECT_ID';

# Instantiates a client
$datastore = new DatastoreClient([
    'projectId' => $projectId
]);

# The kind for the new entity
$kind = 'Task';

# The name/ID for the new entity
$name = 'sampletask1';

# The Cloud Datastore key for the new entity
$taskKey = $datastore->key($kind, $name);

# Prepares the new entity
$task = $datastore->entity($taskKey, ['description' => 'Buy milk']);

# Saves the entity
$datastore->upsert($task);

echo 'Saved ' . $task->key() . ': ' . $task['description'] . PHP_EOL;
在官方客户端库之前,云数据存储中使用最广泛的PHP库仍然在使用和工作,它是


从版本3开始,PHP GDS支持v1 REST API,这意味着您可以在任何计算服务上的应用程序引擎之外使用它。

?是的,我在那里看过-但到目前为止还没有API参考:Stuart说很快就会有一些可用的东西:同时您可以使用API客户端: