RFC: PECL validation extension
| From: | Xavier Noguer | Date: | Wed, 17 Sep 2003 18:21:13 +0000 |
| Subject: | RFC: PECL validation extension | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-21653@lists.php.net to get a copy of this message | ||
Hi, this is just an RFC to get some feedback (and I should propose this thing
on internals anyway), so please no votes :)
I'm developing a pecl extension for "automatically" validating POST and GET
parameters passed to a php script. A more detailed explanation of what it does
can be found at http://www.xavier-noguer.com/framework.html,
so if you have
any interest in this please read that.
What I haven't decided on yet is the following:
- Is there any sense in having an auto_validate option that silently
validates, or is this prone to cause more problems than it would solve?
- Should all parameters declare their method (post or get)?
- Currently, parameters that are received that were not declared simply
ignored. I think I should force all parameters to be declared, and receiving
an undeclared parameter should cause an error.
- I don't have a proper way of handling errors yet. Currently, any failed
validation causes a fatal error. I thought of two solutions for this, logging
errors or having a framework_error() function return the last error. The
function seems cleaner, but logging might be better in case I add the
auto_validate option.
- I don't have a proper name for this thing. The current one is "framework"
but that is definitely a bad name. Any suggestions would be appreciated :)
I would appreciate any critics, comments, suggestions, bug reports and of
course questions. And thank you for your time.
Xavier
http://www.xavier-noguer.com/