Download the PHP package dmamontov/restnormalizer without Composer
On this page you can find all versions of the php package dmamontov/restnormalizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dmamontov/restnormalizer
More information about dmamontov/restnormalizer
Files in dmamontov/restnormalizer
Package restnormalizer
Short Description Normalization data for the transmission via 'Representational State Transfer'.
License BSD-3-Clause
Homepage http://www.slobel.ru/
Informations about the package restnormalizer
REST Normalizer
This class can validate and filter parameters based on JSON rules.
It can take a list of request parameters passed as an array or as a JSON string and validates it according to rules defined in an external files in the JSON format.
The class can traverse the parameter data and check if the entries match the types and validation rules defined in the rules file for the specific type of request.
Invalid values may be discard and logged to a given log file.
The class may also call callback functions before and after the normalization process.
Requirements
- PHP version >5.0
Installation
1) Install composer
2) Follow in the project folder:
In config composer.json
your project will be added to the library dmamontov/restnormalizer
, who settled in the folder vendor/
. In the absence of a config file or folder with vendors they will be created.
If before your project is not used composer
, connect the startup file vendors. To do this, enter the code in the project:
Data types and values to be formatted
The data type "string"
- required - Checking the mandatory values, accepts parameters (true, false)
- default - Default
- max - The maximum allowable length of the string
- min - The minimum allowable length of the string
- pad - Supplemented with the symbol (default: " ")
The data type "int"
- required - Checking the mandatory values, accepts parameters (true, false)
- default - Default
- max - The maximum allowable value
- min - The minimum allowable value
The data type "double"
- required - Checking the mandatory values, accepts parameters (true, false)
- default - Default
- max - The maximum allowable value
- min - The minimum allowable value
- decimals - The number of digits after the decimal point
The data type "bool"
- required - Checking the mandatory values, accepts parameters (true, false)
- default - Default
The data type "datetime"
- required - Checking the mandatory values, accepts parameters (true, false)
- default - Default (default: "now")
- format - Date and time format
The data type "enum"
- required - Checking the mandatory values, accepts parameters (true, false)
- default - Default
- values - An array of enumerated values