Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

SuperGlobal Class Reference

List of all members.

Public Member Functions

 __construct ($array)
 raw ($index)
 escape ($index)
 getArrayCopy ()
 get_array_copy_raw ()
 current ()
 offsetGet ($index)
 offsetSet ($index, $value)
 merge ()
 filter_keys ()
 map ($fn)
 rekey ($replacement= '{\$$0}', $search_regex= '/^.*$/')

Static Public Member Functions

static process_gps ()
static process_c ()

Protected Member Functions

 base_filter ($value)

Protected Attributes

 $values = array()
 $raw_values = array()

Detailed Description

SuperGlobals class

Definition at line 13 of file superglobal.php.


Member Function Documentation

SuperGlobal::base_filter ( value  )  [protected]

Recursively filter array values and strings using InputFilter::filter()

Parameters:
mixed $value A value to filter
Returns:
mixes The filtered value

Definition at line 169 of file superglobal.php.

Referenced by offsetGet().

SuperGlobal::current (  ) 

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

Definition at line 127 of file superglobal.php.

SuperGlobal::escape ( index  ) 

Return the raw, escaped value of the requested index. We escape with htmletities with the ENT_QUOTE flag.

Parameters:
mixed $index The index of the value
Returns:
mixed The unfiltered value When our requirement is bumped to PHP 5.4 change flag to ENT_QUOTES | ENT_HTML5

Definition at line 103 of file superglobal.php.

SuperGlobal::filter_keys (  ) 

Filters this SuperGlobal based on an array or arrays of keys

Parameters:
mixed An array of key values that should be returned, or a string of a key value to be returned
Returns:
SuperGlobal The values from this array that match the supplied keys

Definition at line 239 of file superglobal.php.

SuperGlobal::get_array_copy_raw (  ) 

Return a copy of the unfiltered array.

Definition at line 119 of file superglobal.php.

Referenced by filter_keys(), map(), merge(), offsetGet(), raw(), and rekey().

SuperGlobal::getArrayCopy (  ) 

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

Definition at line 111 of file superglobal.php.

Referenced by get_array_copy_raw().

SuperGlobal::map ( fn  ) 

Apply a map function to this array, like array_map()

Parameters:
callback $fn the name of the function to map through
Returns:
SuperGlobal the result of the mapping

Definition at line 259 of file superglobal.php.

SuperGlobal::merge (  ) 

Merges the contents of one or more arrays or ArrayObjects with this SuperGlobal

Parameters:
mixed One or more array-like structures to merge into this array.
Returns:
SuperGlobal The merged array

Definition at line 188 of file superglobal.php.

SuperGlobal::offsetGet ( index  ) 

Return the value of an array offset. Allows the values to be filtered

Parameters:
mixed $index The index of the array
Returns:
mixed The filtered value at the array index

Definition at line 138 of file superglobal.php.

Referenced by current().

SuperGlobal::offsetSet ( index,
value 
)

Set the value of the array, clear caches for that index

Parameters:
mixed $index The array index
mixed $value Tha value to store

Definition at line 156 of file superglobal.php.

static SuperGlobal::process_c (  )  [static]

Convert $_COOKIE into SuperGlobal instance

Definition at line 58 of file superglobal.php.

static SuperGlobal::process_gps (  )  [static]

Convert $_GET, $_POST and $_SERVER into SuperGlobal instances, also kill $_REQUEST

Returns:

Definition at line 31 of file superglobal.php.

SuperGlobal::raw ( index  ) 

Return the raw, unfiltered value of the requested index

Parameters:
mixed $index The index of the value
Returns:
mixed The unfiltered value

Definition at line 83 of file superglobal.php.

Referenced by escape().

SuperGlobal::rekey (  ) 

Use a regular expression replacement to change the keys in an array

Parameters:
string $replacement (optional) The regex replacement value
string $search_regex (optional) The regex search value
Returns:
SuperGlobal The re-keyed array

Definition at line 270 of file superglobal.php.


The documentation for this class was generated from the following file: