Configuration
From PhpInputValidator
The phpInputValidator has default configuration settings that will be setup when no values override them. So if you do not want to configure the system you don't have to.
Contents |
How to configure
To configure phpInputValidator you can do one of two ways. First is to pass an array of configuration values to the constructor when creating a new instance of the class. Here is an example:
$getvar = phpInputValidator::getInstance($config);
Second is to use a the config method:
$getvar->config->date_format('D, d M Y H:i');
$getvar->config->language('en_us');
Configuration options
add_slashes (bool)
Add slashes to strings
Example
-- OR --
add_slashes_function (string)
A function to run to add slashes to data. By default the php function addslashes is run to add slashes to a string.
However it is generally better to run a DB specific function for adding slashes. A couple of examples of better functions to use might be mysqli_real_escape_string or mysql_real_escape_string. Which you can use by using this configuration option.
Example
-- OR --
date_format (string)
This is the formatting you wish to apply to the date and time on logged events. The string needs to follow the php date function formatting. An example: 'D, d M Y H:i'
Example
-- OR --
error_log (string)
This is the name and location you wish to give the error log. If one is not given errors are not logged.
Example
-- OR --
language (string)
The language file to load.
Example
-- OR --
log_path (string)
This is the name and location you wish to give the log. If one is not given then use is not logged.
Example
-- OR --