我正在尝试为密码散列制作自定义算法。我尝试这样做。
在 app.cfg 中:
sf_guard_plugin:
algorithm_callable: [Hlp, noHash]
在应用程序/前端/lib/Hlp.php 中:
class Hlp
{
function noHash($password) //tried to make public or public static, but it didn't work either
{
return $password;
}
}
在我的数据库中,“算法”设置为“noHash”。当我尝试登录时,出现以下错误:
可调用的算法“noHash”是不可调用的。
我正在使用 php 5.2。
我究竟做错了什么?
更新 app.yml 中的更改:algorithm_callable:'Hlp::noHash'
将 db 中的算法更改为 'Hlp::noHash'
将 hakre 的答案标记为正确以提供有用的提示。