YANA 4 PHP Framework
Docs for page toolbox.php
Common tools
This file contains a variety of tools that might be usefull to all applications, no matter wether the use the rest of the framework or not.
Name | Type | Description |
---|---|---|
$A | array | |
$case | int|bool | CASE_UPPER or CASE_LOWER |
$input |
This is a recursive implementation of the PHP function array_change_key_case(). It takes the same arguments: an array $input to work on and an optional argument $case. The argument $case can be one of two constants: CASE_LOWER and CASE_UPPER, where CASE_LOWER is the default.
Name | Type | Description |
---|---|---|
$array | array |
This function creates a deep-copy of the input $array and returns it.
"Deep-copy" means, it tries to clone objects registered in the array by calling the function "copy()", if the object has any, or by using the keyword "clone" as of PHP 5.
Note that this will not work correctly, if the object has neither the one nor the other.
Name | Type | Description |
---|---|---|
$dir | string | |
$filter | string | |
$switch |
The argument $filter may contain multiple file extension, use a pipe '|' sign to seperate them. Example: "*.xml|*.html" will find all xml- and html-files
Name | Type | Description |
---|---|---|
$A | array | |
$B | array |
This function is pretty much the same as the php function "array_merge_recursive" except for the way how duplicate keys are treated. Dupplicate keys get replaced in this implementation rather than being appended.
Name | Type | Description |
---|---|---|
$value | mixed | the input data |
$type | string | desired type, note that this should always be a scalar type |
$length | int | maximum length (as number of characters!), note that a float of 10.3 and length 3 will convert to 10., NOT 10.3! |
$escape | int | choose how special characters should be treated |
This function scrubbs your user input data shiny and clean.
It ensures: the data has a given type, maximum length, and syntax. E.g. if the data comes out of an input-field use this function with the argument $escape set to YANA_ESCAPE_LINEBREAK, to enforce the input does not have any unexpected line breaks.
Valid values for parameter $type:
Valid values for parameter $escape:
Documentation generated on Wed, 22 Nov 2006 20:19:25 +0100 by phpDocumentor 1.3.1