简体   繁体   English

Yii2类yii \\ authclient \\ clients \\ GoogleOAuth不存在

[英]Yii2 Class yii\authclient\clients\GoogleOAuth does not exist

I use dektrium/yii2-user (on one project) and yiisoft/yii2-authclient (on another one) to login via Google account. 我使用dektrium / yii2-user(在一个项目上)和yiisoft / yii2-authclient(在另一个项目上)通过Google帐户登录。 Some time ago it was everything ok, but i guess after last composer update something was changed and now i get an error: "Class yii\\authclient\\clients\\GoogleOAuth does not exist" when try to open login page. 前段时间一切都还好,但我想在最后一个作曲家更新之后发生了一些变化,现在我得到一个错误:当尝试打开登录页面时,“类yii \\ authclient \\ clients \\ GoogleOAuth不存在”。 Does anybody has the same issue or know what's wrong? 有没有人有同样的问题或知道什么是错的? Thank you 谢谢

yii2-authclient has been modified in the latest version which is not backward compatible. yii2-authclient已在最新版本中进行了修改,该版本不向后兼容。
Read about the upgrade process here . 在此处阅读升级过程

Two solutions: 两种解决方案

  1. Modify composer.json to fetch 2.0.6 version (replace * with 2.0.6 ) - no other changes are needed but no more updates for this extension. 修改composer.json以获取2.0.6版本(用2.0.6替换* ) - 不需要进行其他更改,但不再需要此扩展的更新。
  2. Upgrade your code following the guide in the link above so you can be up-to-date. 按照上面链接中的指南升级您的代码,以便您可以获得最新信息。

In the config file Replace from 在配置文件中替换

'google'   => [
            'class'        => 'yii\authclient\clients\GoogleOAuth',
            ..
        ],

Replace to 替换为

'google' => [ 'class' => 'yii\\authclient\\clients\\Google', ... ], 'google'=> ['class'=>'yii \\ authclient \\ clients \\ Google',...],

在配置文件中使用yii \\ authclient \\ clients \\ Google而不是yii \\ authclient \\ clients \\ GoogleOAuth。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM