skip to Main Content

I’m trying to migrate my App to Google App Engine php7.2. The Main problem is, that sessions are stored in Memcache. But I need more consistent sessions.

I’ve found a nice Repo that should solve the Problem https://github.com/tomwalder/php-gds-session But it throws an error after installation and inclusion.

Error: Class ‘googleappenginedatastorev4LookupRequest’ not found
at GDSGatewayProtoBuf->fetchByKeyPart (/srv/vendor/tomwalder/php-gds/src/GDS/Gateway/ProtoBuf.php:179)
at GDSGateway->fetchByNames (/srv/vendor/tomwalder/php-gds/src/GDS/Gateway.php:194)
at GDSGateway->fetchByName (/srv/vendor/tomwalder/php-gds/src/GDS/Gateway.php:122)
at GDSStore->fetchByName (/srv/vendor/tomwalder/php-gds/src/GDS/Store.php:184)
at GDSSessionHandler->read (/srv/vendor/tomwalder/php-gds-session/src/GDS/Session/Handler.php:176)
at session_start ([internal function])
at GDSSessionHandler::start (/srv/vendor/tomwalder/php-gds-session/src/GDS/Session/Handler.php:105)
at {main} (/srv/bootstrap.php:12)

Can anybody help?

my composer.json:

"require": {
    "php": ">=5.3.0",
    "google/cloud-logging": "^1.16",
    "google/cloud-error-reporting": "^0.14.4",
    "google/cloud-storage": "^1.12",
    "google/cloud-datastore": "^1.9",
    "monolog/monolog": "^1.24",
    "league/flysystem-sftp": "^1.0",
    "aws/aws-sdk-php": "^3.94",
    "vlucas/phpdotenv": "^3.3",
    "php-http/guzzle6-adapter": "^1.1",
    "bugsnag/bugsnag": "^3.16",
    "mailgun/mailgun-php": "~2.0",
    "paragonie/random_compat": "<9.99",
    "tomwalder/php-gds-session": "v1.0.0",
    "google/apiclient": "^2.2"
  }

on top of bootstrap.php

// Fix for finding Application-ID on GAE
if(!isset($_SERVER['APPLICATION_ID'])){
   $_SERVER['APPLICATION_ID'] = $_SERVER['GAE_APPLICATION'];
}
GDSSessionHandler::start();

2

Answers


  1. You could try changing the php-gds-session code from use GDSGatewayProtoBuf; to use GDSGatewayRESTv1; and new Store($this->createSchema(), new ProtoBuf()); to new Store($this->createSchema(), new RESTv1());

    Login or Signup to reply.
  2. I’m the author of PHP-GDS. the reason it fails is that the new PHP 7.x runtimes do not have the same type of ProtoBuf support.

    The REST alternative should work.

    I’ll take a look at the library and see if I can provide a version that supports the REST gateway.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search