dream02008 2019-02-26 11:03
浏览 55
已采纳

为什么我在Firestore SDK for PHP中为已弃用的类获取错误?

After upgrading to newer version of 'google/cloud-firestore' i'm getting an error.

That's error got:

Google\Cloud\Firestore\V1beta1\StructuredQuery_CollectionSelector is deprecated and will be removed in the next major release. Use Google\Cloud\Firestore\V1beta1\StructuredQuery\CollectionSelector instead at /var/www/procare-vendor/google/cloud/Firestore/src/V1beta1/StructuredQuery_CollectionSelector.php 15

There is my composer.json

    {
  "require": {
    "phpoffice/phpexcel" : "1.8.1",
    "phpmailer/phpmailer": "~5.2",
    "katzgrau/klogger": "dev-master",
    "itbz/fpdf": "1.7.3",
    "microsoft/windowsazure" : "*",
    "guzzlehttp/guzzle": "~6.0",
    "predis/predis": "^1.1",
    "google/cloud-firestore": "^1.1.0"
  }
}

PHP version 7.0.31 with gRPC extension installed

  • 写回答

2条回答 默认 最新

  • dongll0502 2019-02-27 13:15
    关注

    I found the issue.

    I have had an custom error handler in my project, which overwrites default php error handling and all configurations for error handling.

    That's the code:

    //Deal with catchable PHP errors
    if (AppConfig::resolveEnv() != AppConfig::ENV_LIVE && ! Request::getInstance()->isInConsole) {
        set_error_handler(function ($errno , $errstr, $errfile = null, $errline = null, $errcontext = array() ) {
    
            $ex = new AppException("{$errstr} at {$errfile} {$errline}");
            Application::getInstance()->renderKernelPanicAlert($ex);
        }, E_ALL);
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?