나는 Kohana 3의 인증 클래스와 로그인 스크립트를보고있다. 로그인 페이지가 auth 클래스의 로그인 함수를 호출하면 보호 된 추상 함수 _login을 통해 반환됩니다. 왜 호기심에서 그걸 할 수 있니? 나는 당신이 동일한 데이터를 어느 쪽이든 반환 할 것이기 때문에 실제로 어떤 차이가 있는지 이해하지 못하는 것 같습니다. 내 머리 속에서 헤엄 치는 한 가지 옵션은 보호 된 추상을 통해 반환하면 auth-> login 함수에 넣은 시간과 데이터를 남겨 둘 때부터 데이터가 수정되지 않았 음을 확인하는 것입니다. 미묘한 차이를 이해하려고 노력 중입니다. 감사.추상 보호 기능을 통해 반환 하시겠습니까?
public function login($username, $password, $remember = FALSE)
{
if (empty($password))
return FALSE;
if (is_string($password))
{
// Get the salt from the stored password
$salt = $this->find_salt($this->password($username));
// Create a hashed password using the salt from the stored password
$password = $this->hash_password($password, $salt);
}
return $this->_login($username, $password, $remember);
}
하고 ....
abstract protected function _login($username, $password, $remember);