0

我试图利用项目https://github.com/sonata-project/GoogleAuthenticator 我首先安装了这个项目: composer require sonata-project/google-authenticator 。在此之后,当我想查看操作时收到错误消息

PHP 致命错误:在第 19 行的 /home/######/vendor/sonata-project/google-authenticator/src/GoogleAuthenticator.php 中找不到接口“Sonata\GoogleAuthenticator\GoogleAuthenticatorInterface”

我是不是忘记了什么?

任何帮助,将不胜感激!

4

2 回答 2

1

将以下行添加到 src 文件夹中的 GoogleAuthenticator.php 文件

include_once 'GoogleAuthenticatorInterface.php';
于 2021-08-23T06:16:29.993 回答
1

我想你解决了这个问题,或者以某种方式解决了这个问题。但我的答案正在改变

include_once __DIR__.'/src/FixedBitNotation.php';
include_once __DIR__.'/src/GoogleAuthenticator.php';
include_once __DIR__.'/src/GoogleQrUrl.php';
include_once __DIR__.'/src/FixedBitNotation.php';
include_once __DIR__.'/src/GoogleAuthenticatorInterface.php';
include_once __DIR__.'/src/GoogleAuthenticator.php';
include_once __DIR__.'/src/GoogleQrUrl.php';

即添加:include_once __DIR__.'/src/GoogleAuthenticatorInterface.php';

于 2021-07-21T07:28:25.070 回答