php - OAuth 2.0 服务器 PHP,找不到接口(interface)

标签 php interface namespaces oauth-2.0

我遇到了一个小问题 OAuth 2.0 Server PHP ,我想在我的项目中使用它。这是我的项目的 TreeView :

/Model/ Contains all the classes for managing API

/Lib/ Contains all third-party libraries


根命名空间为“IO”,模型为“IO\Model”,库为“IO\Lib”。我的问题来自命名空间,目前类“IO\Lib\OAuth2\Storage\Pdo”是众所周知的,但没有找到接口(interface)。我以前在其他项目中从未遇到过这个问题。
OAuth 2.0 服务器 PHP 库到它自己的命名空间“OAuth2”。这是我的脚本 Auth.php:
namespace IO\Model;

use IO\Lib\OAuth2 as OAuth2;

class Auth {
  public function __construct() {
    $this->config = Config::getInstance();
    
    $storage = new OAuth2\Storage\Pdo(
      array(
        'dsn' => 'mysql:dbname='.$this->config->sql_database.';host='.$this->config->sql_host,
        'username' => $this->config->sql_user,
        'password' => $this->config->sql_password
      )
    );
    $server = new OAuth2\Server($storage);
  }
}
我收到此错误:

Fatal error: Interface 'OAuth2\Storage\AuthorizationCodeInterface' not found in /Lib/OAuth2/Storage/Pdo.php on line 19

最佳答案

根据之前的答案,如果自动加载器失败,则手动运行加载器的解决方案
下面给出
Check this link

关于php - OAuth 2.0 服务器 PHP,找不到接口(interface),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22744447/

相关文章:

javascript - 通过 JavaScript 动态触发命名空间方法

.net - 在 Visual Studio 的 Intellisense 中隐藏接口(interface)方法

pointers - golang 异常规则 "interface pointer can' t 实现接口(interface)”

c++ - 如何正确使用命名空间避免名称冲突?

php - 如何在 Yii2 上命名模型规则?

javascript - 如何根据服务器上的内容更新客户端 JavaScript?

php - 哪一个代码可以更快地处理 PHP 注释?有想法吗?

php - 播种一对多关系

class - 为什么要在句法层面区分接口(interface)和抽象类?

Chicken Scheme 中的命名空间