RE: [PEAR-DEV] Validation class comments

From: Date: Tue, 28 May 2002 18:32:15 +0000
Subject: RE: [PEAR-DEV] Validation class comments
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-6541@lists.php.net to get a copy of this message
On Tue, 2002-05-28 at 20:30, Richard Heyes wrote: > > > 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); > } > ... Hint: Take a look at PEAR/Autoloader.php - Stig

« previous php.pear.dev (#6541) next »