Re: Validate package
| From: | Davey | Date: | Fri, 05 Nov 2004 23:57:45 +0000 |
| Subject: | Re: Validate package | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-34219@lists.php.net to get a copy of this message | ||
Pierre-Alain Joye wrote:
On Fri, 05 Nov 2004 09:05:52 +0100 lsmith@php.net (Lukas Smith) wrote:What if Validate.php included all the code into it that it currently has? So if you do require_once 'Validate.php'; you would get all the functions that were there before. But if you only want to validate e-mail you could do require_once 'Validate/Email.php'; It would break BC though, so moot point. This shoulda been thought of from the start ;) - DaveyNorbert Mocsnik wrote:And the counter part is that you will include 10 files when you will check more datas... The only thing I would like to split is the locale validations (DE, AT, CH,...). That will make the life easier for everyone, and the main package will remain with what it owns now (text, date, mail, uri,...). Regards, --PierreHi devs, Did anyone ever think of splitting the Validate package into multiple files to avoid including 700+ lines of code with 10+ functions when only validating a string or e-mail address? Are there any drawbacks of splitting it (besides a possible BC-break?)Yes there is the problem if file I/O. Its quite expensive. AFAIK its still a significant cost if you use the bytecode cache. However the 700 lines are a non-issues if you use a bytecode cache.