RE: [PEAR-DEV] Validation class comments
| From: | Tomas V.V.Cox | Date: | Tue, 28 May 2002 18:55:34 +0000 |
| Subject: | RE: [PEAR-DEV] Validation class comments | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-6543@lists.php.net to get a copy of this message | ||
El mar, 28-05-2002 a las 20:30, Richard Heyes escribió:
> > > I can't imagine a lot of cases when ALL this functions will be necessary.
> > > So such class must have pluggable architecture, and allow easily include and
> > > exclude validation functions from working script.
> >
> > Normally validation methods are small and I'm against having to include
> > 10 files for just do the common validations. To include a 20K file (if
> > it reach that size at some point) is better than include 3 o 4 files of
> > 5K.
>
> On this point, you could always use some sort of autoload functionality.
> Eg:
>
> ...
> function isEmail($email)
> {
> require_once('Mail/RFC822.php');
> return Mail_RFC822::isValidInetAddress($email);
> }
>
> function isCCNumber($number)
> {
> require_once('CC/blaat.php');
> return CC_blaat::isValidCCNumber($number);
> }
> ...
>
I'm talking about performance not easy of use :-)
Tomas V.V.Cox