我想製作自定義密碼散列算法。我嘗試這樣做。sfGuard自定義算法_callable
在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'。 當我嘗試登錄我獲得以下錯誤:
The algorithm callable "noHash" is not callable.
我使用PHP 5.2。
我在做什麼錯?
UPDATE 變化app.yml:algorithm_callable: 'HLP :: noHash'
改變了DB algorith爲 'HLP :: noHash'
標誌hakre的答案是正確的提供有用的提示。
您的班級文件是否正在加載?如果不是,則該函數不可調用。檢查錯誤日誌。 – hakre 2011-06-17 08:04:32
hakre,我在這堂課還有其他功能,並且在我網頁的其他部分工作得很好。我沒有在日誌中看到有關Hlp類的任何提及。 – biggusebun 2011-06-17 08:12:39