php-gds datastore API v1致命错误:未找到类'google \ appengine \ datastore \ v4 \ RunQueryRequest'

时间:2016-09-15 02:52:47

标签: php google-app-engine

使用datastore-api-v1

以下是我的示例代码:


    $obj_gateway = new GDS\Gateway\ProtoBuf("Test123");

    $obj_schema = (new GDS\Schema("Messages"))
        ->addString('message_id')
        ->addString('type')
        ->addString('action')
        ->addInteger('to')
        ->addDatetime('created_at')
        ->addString('status')
        ->addString('message', FALSE);

    $obj_store = new GDS\Store($obj_schema,$obj_gateway);


    $query = "SELECT * FROM notifications WHERE `to` = 1 ORDER BY created_at";
    $obj_store->query($query);
    $arr_page = $obj_store->fetchPage(10, 0);


这是错误:

Fatal error: Class 'google\appengine\datastore\v4\RunQueryRequest' not found in /usr/share/nginx/html/csfiles/third_party/gds/vendor/tomwalder/php-gds/src/GDS/Gateway/ProtoBuf.php on line 164

1 个答案:

答案 0 :(得分:1)

对于任何发现此问题的人,我已在GitHub上回答了

https://github.com/tomwalder/php-gds/issues/134#issuecomment-247261645

ProtoBuf仅适用于AppEngine环境。 在非AppEngine环境中使用RESTv1。

干杯!