Re: [PHP-PEAR] RFC on merge of PHPLib and Pear

[email protected] ((Kristian Koehntopp)) 10 Mar 2001 11:59:50 -0000
Newsgroups netuse.lists.php-pear
Message-ID <[email protected]>
In netuse.lists.php-pear you write:
>I just don't like the way phplib makes you subclass things just to change a
>parameter. I should be able to pass a parameter to the Auth_ip constructor
>to tell it what ips are valid, instead of having to change the class
>definition.

Then write your Auth subclass that way. For example, you could
subclass Auth into an Auth_Sql subclass, which does all the work
of authenticating a username and password against a specific
MySQL database table, and make the database name, the table
name, the field names and the form field names parameters to its
constructor. 

Also, you'd be able to subclass Auth_IP from Auth and be able to
put IP ranges into the constructor. Auth does not care at all,
nor does it force you.

Kristian