PHP Class Habari\SuperGlobal

Inheritance: extends ArrayIterator
Show file Open project: habari/system

Protected Properties

Property Type Description
$raw_values
$values

Public Methods

Method Description
__construct ( $array )
current ( ) Return the current array element, filtered. Implements ArrayIterator::current()
escape ( mixed $index ) : mixed Return the raw, escaped value of the requested index.
filter_keys ( ) : SuperGlobal Filters this SuperGlobal based on an array or arrays of keys
getArrayCopy ( ) Return a copy of the filtered array. Implments ArrayIterator::getArrayCopy()
get_array_copy_raw ( ) Return a copy of the unfiltered array.
map ( callback $fn ) : SuperGlobal Apply a map function to this array, like array_map()
merge ( ) : SuperGlobal Merges the contents of one or more arrays or ArrayObjects with this SuperGlobal
offsetGet ( mixed $index ) : mixed Return the value of an array offset. Allows the values to be filtered
offsetSet ( mixed $index, mixed $value ) Set the value of the array, clear caches for that index
process_c ( ) Convert $_COOKIE into SuperGlobal instance
process_gps ( ) Convert $_GET, $_POST and $_SERVER into SuperGlobal instances, also kill $_REQUEST
raw ( mixed $index ) : mixed Return the raw, unfiltered value of the requested index
rekey ( string $replacement = '{\$$0}', string $search_regex = '/^.*$/' ) : SuperGlobal Use a regular expression replacement to change the keys in an array

Protected Methods

Method Description
base_filter ( mixed $value ) : mixes Recursively filter array values and strings using InputFilter::filter()

Method Details

__construct() public method

public __construct ( $array )

base_filter() protected method

Recursively filter array values and strings using InputFilter::filter()
protected base_filter ( mixed $value ) : mixes
$value mixed A value to filter
return mixes The filtered value

current() public method

Return the current array element, filtered. Implements ArrayIterator::current()
public current ( )

escape() public method

We escape with htmletities with the ENT_QUOTE flag.
public escape ( mixed $index ) : mixed
$index mixed The index of the value
return mixed The unfiltered value

filter_keys() public method

Filters this SuperGlobal based on an array or arrays of keys
public filter_keys ( ) : SuperGlobal
return SuperGlobal The values from this array that match the supplied keys

getArrayCopy() public method

Return a copy of the filtered array. Implments ArrayIterator::getArrayCopy()
public getArrayCopy ( )

get_array_copy_raw() public method

Return a copy of the unfiltered array.
public get_array_copy_raw ( )

map() public method

Apply a map function to this array, like array_map()
public map ( callback $fn ) : SuperGlobal
$fn callback the name of the function to map through
return SuperGlobal the result of the mapping

merge() public method

Merges the contents of one or more arrays or ArrayObjects with this SuperGlobal
public merge ( ) : SuperGlobal
return SuperGlobal The merged array

offsetGet() public method

Return the value of an array offset. Allows the values to be filtered
public offsetGet ( mixed $index ) : mixed
$index mixed The index of the array
return mixed The filtered value at the array index

offsetSet() public method

Set the value of the array, clear caches for that index
public offsetSet ( mixed $index, mixed $value )
$index mixed The array index
$value mixed Tha value to store

process_c() public static method

Convert $_COOKIE into SuperGlobal instance
public static process_c ( )

process_gps() public static method

Convert $_GET, $_POST and $_SERVER into SuperGlobal instances, also kill $_REQUEST
public static process_gps ( )

raw() public method

Return the raw, unfiltered value of the requested index
public raw ( mixed $index ) : mixed
$index mixed The index of the value
return mixed The unfiltered value

rekey() public method

Use a regular expression replacement to change the keys in an array
public rekey ( string $replacement = '{\$$0}', string $search_regex = '/^.*$/' ) : SuperGlobal
$replacement string (optional) The regex replacement value
$search_regex string (optional) The regex search value
return SuperGlobal The re-keyed array

Property Details

$raw_values protected property

protected $raw_values

$values protected property

protected $values