【发布时间】:2015-04-17 08:55:48
【问题描述】:
我有一个免费安装的 Cakephp 3.0 实例和几个代码示例,一切正常。现在我想在./src/Auth 中创建一个Auth 组件,涉及文档here
这是我的代码:
<?php
namespace App\Auth;
use Cake\Auth\BaseAuthenticate;
class AlephAuthenticate extends BaseAuthenticate
{
public function authenticate(Request $request, Response $response)
{
// Do things for OpenID here.
// Return an array of user if they could authenticate the user,
// return false if not.
}
}
在 AppContoller.php 我初始化这个组件:
public function initialize() {
$this->loadComponent('Auth');
$this->Auth->config('authenticate', ['Aleph']);
}
在浏览器中调用应用程序URL显示:
致命错误:App\Auth\AlephAuthenticate::authenticate() 的声明必须与 /var 中的 Cake\Auth\BaseAuthenticate::authenticate(Cake\Network\Request $request, Cake\Network\Response $response) 兼容/www/art/src/Auth/AlephAuthenticate.php 第 7 行
知道这里有什么问题吗?
谢谢!
克里斯托夫
【问题讨论】:
标签: php cakephp authentication