Extensible Request filtering
This class provides input filtering for request data provided through an UnifiedRequest object (what means you will have to name the arguments e.g. for XMLRPC requests first). It checks for the correct typing in cases where types are present (this is true for XMLRPC but not HTTP POST/GET) and provides you will correctly typed (php types) data.
It provides acccess to scalar types (string, boolean, integer, float) by default but is extensible through RequestFilterCustom objects.
Error handling can be done via two methods:
Located in /phpsatk-lib/global/org.eenterphace.sat.request.filter/request.filter.php (line 50)
Initialize a new Filter based on the given request data.
Checks whether a given argument is avaialable in the given type.
Available types:
Validates a value using an external filter.
External filters are classes which implement RequestFilterCustom and implement one single method "filter" which performs specific tasks on the given argument and returns it on success or throws a RequestException.
Either a object of a class implementing RequestFilterCustom may be given as filter or some symbolic name - in this case a class providing "request.filter.$name" is searched and if present used as a filter.
Gets an array
Warning: array elements are not checked anyway.
Fetches a boolean value
Allows symbolic values ('true', 'yes' <-> 'false', 'no') additionally to 0/1.
Gets a floating point value
Returns zero if not present. Automatical conversion of decimal signs (',' to '.').
Gets a float which mustn't be zero
Gets a integer value
Will return zero if not set (can't check for this- at least using HTTP).
Gets a integer value which mustn't be zero
Gets a string
If the safe parameter is set, all tags will automatically stripped off to provide safe content for output.
Returns an empty string if the argument is not given.
Gets a string which mustn't be empty
Fetches a string and valides by a regular expression (perl-style)
In safe mode tags are stripped off before applying the regex.
Checks whether an error has occured.
Always returns false if there is no userErrorHandler.
Sets a UserErrorHandler
If set no more exceptions will be thrown. You will have to decide for yourself, what you want to do with the errors given.
One example for a UserErrorHandler is the Output object. Request handlers 'should' present the errors stored there in some way, but you still need to react to the errors in you application.
Invokes the userErrorHandler if present.
In case no userErrorHandler was set, throws a RequestException with the message passed. Otherwise the error will be added to the UserErrorHandler.
Documentation generated on Mon, 21 May 2007 10:35:15 +0200 by phpDocumentor 1.3.0RC5