Re: init() method

Matthias Nothhaft <[email protected]> Sun, 11 Dec 2005 17:47:03 +0100
Newsgroups gmane.comp.php.pear.liveuser
Message-ID <[email protected]>
Lukas Kahwe Smith schrieb:
> Hi,
> 
> we recently got the following feature request:
> http://pear.php.net/bugs/bug.php?id=6215
> 
> To cite from a comment I made there:
> 
> While thinking about this request I have begun wondering if we should
> not severely trim down init() to essentially just the _unfreeze() call,
> the idle/expire handling and the forceLogin event.
> 
> It would then be up to the user to call login() and logout()
> themselves. This would obviously be a big BC break.
For me it isn't that big BC break because login/logout happens an a
central place in my apps - changing checkRight() would be more critical. ;-)

But I think that it would be a better concept to clearly separate init,
login and logout - easier to explain and to understand what happens.

init should init, login should login and logout should logout ;-)

By the way, it would be very nice if you could re-order some methods so
that public methods are first and private methods at the end of the
LiveUser class to make it more readable?

init, login, logout, checkRight and such should be at the beginning.
methods like arrayMergeClobber, _startSession, _unfreeze or the cookie
stuff is not that important to understand the API...

I would do that, but I am not allowed to commit ;-)

Regards,
Matthias