我的composer.json中有以下内容(没有显示无关的包):
"require": {
"googleads/googleads-php-lib": "^39.0",
"google/apiclient": "2.7.2",
"google/cloud-storage": "^1.23",
"googleads/google-ads-php": "^14.0",
"phpseclib/phpseclib": "2.0.31"
}我已经确认正在调用vender/autooload.php。但是当我使用这个代码时:
$default_scope_set = array(
Google\Service\Plus::PLUS_LOGIN,
Google\Service\Plus::PLUS_ME,
Google\Service\Plus::USERINFO_EMAIL,
);我知道错误:
Error: Class 'Google\Service\Plus' not found in /home/httpd/idxv3/lib/GoogleAuthenticator.php:38我只是不知道我哪里出了问题。有什么想法吗?
发布于 2022-04-20 16:17:07
好吧,有几处改变解决了我的问题:
移除多年前这段代码的介绍遗留的Google+引用。
更改下划线引用以使用命名空间
将旧api-客户端升级到2.12.1。我知道有两个更新的版本,但是google页面的api-client使用的是2.12.1,所以我现在就坚持这样做。我的问题解决了。
https://stackoverflow.com/questions/71888816
复制相似问题