Re: Re: A session class (was Re: [PEAR-DEV] Namespace issues)
| From: | Martin Jansen | Date: | Fri, 17 May 2002 16:57:42 +0000 |
| Subject: | Re: Re: A session class (was Re: [PEAR-DEV] Namespace issues) | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-6204@lists.php.net to get a copy of this message | ||
On Fri, 17 May 2002 09:07:04 -0700 (PDT), David Norman wrote:
>I haven't used Stig's Auth class. Perhaps I haven't read this list
>close enough, but I wonder why there is such a cry for a grand
>"authentication system". I've found nothing wrong with just something
>like:
>
> if(!strcmp($_POST["login_username"], 'deekayen')
> && !strcmp($_POST["login_pass"], 'asdf')) {
>
> $_SESSION["user"]["username"] = 'deekayen';
> $_SESSION["logged_in"] = true;
Basically you can substiture *every* package from PEAR with some lines
of "simple" PHP code. But PEAR aims to provide reusable and standard
compliant code, which your example above definitively not is.
In case of the authentication class, we also provide some abstract
storage containers like databases, text files or LDAP servers that
are easily accessible and have a clean-structured API. The clean
structured API again applies to all PEAR code and you can't really
say that your example has a (clean) API ;-).
- Martin
--
Martin Jansen, <mail@martin-jansen.de>
http://www.martin-jansen.de/