public static function logIn($username, $password)
    {
        if (!$username)
        {
            throw new AVException("Cannot log in user with an empty name");
        }
        if (!$password)
        {
            throw new AVException("Cannot log in user with an empty password.");
        }
        $data = array("username" => $username, "password" => $password);
        $result = AVClient::_request("GET", "/login", "", $data);
        $user = new AVUser();
        $user->_mergeAfterFetch($result);
        $user->handleSaveResult(true);
        AVClient::getStorage()->set("user", $user);

        return $user;
    }
public static function logIn($username, $password)
    {
        if (!$username)
        {
            throw new AVException("Cannot log in user with an empty name");
        }
        if (!$password)
        {
            throw new AVException("Cannot log in user with an empty password.");
        }
        $data = array("username" => $username, "password" => $password);
        $result = AVClient::_request("GET", "/login", "", $data);
        $user = new AVUser();
        $user->_mergeAfterFetch($result);
        $user->handleSaveResult(true);
        AVClient::getStorage()->set("user", $user);

        return $user;
    }
public static function logIn ( $ username , $ password ) { if ( ! $ username ) { throw new AVException ( "Cannot log in user with an empty name" ) ; } if ( ! $ password ) { throw new AVException ( "Cannot log in user with an empty password." ) ; } $ data = array ( "username" => $ username , "password" => $ password ) ; $ result = AVClient :: _request ( "GET" , "/login" , "" , $ data ) ; $ user = new AVUser ( ) ; $ user -> _mergeAfterFetch ( $ result ) ; $ user -> handleSaveResult ( true ) ; AVClient :: getStorage ( ) -> set ( "user" , $ user ) ; return $ user ; }
Logs in a and returns a valid AVUser, or throws if invalid.

@param string $username
@param string $password

@return AVUser

@throws AVException
Logs in a and returns a valid AVUser or throws if invalid .