我遇到了一个小问题 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/