add compatibility library for password functions (PHP<=5.5)

This commit is contained in:
coderkun 2014-01-29 16:45:45 +01:00
commit 0e7ea50bd5
2 changed files with 326 additions and 0 deletions

View file

@ -218,6 +218,11 @@
*/
public function hash($password)
{
if(!function_exists('password_hash')) {
\hhu\z\lib\Password::load();
}
return password_hash($password, PASSWORD_DEFAULT);
}
@ -231,6 +236,11 @@
*/
private function verify($password, $hash)
{
if(!function_exists('password_verify')) {
\hhu\z\lib\Password::load();
}
return password_verify($password, $hash);
}