Class Inspekt_Cage

Description

Implements interfaces:

  • IteratorAggregate (internal interface)
  • ArrayAccess (internal interface)
  • Countable (internal interface)

Located in /Inspekt/Cage.php (line 24)


	
			
Direct descendents
Class Description
Inspekt_Cage_Session
Variable Summary
HTMLPurifer $purifier
array $_source
Method Summary
static Inspekt_Cage Factory ( &$source, [string $conf_file = NULL], [string $conf_section = NULL], [boolean $strict = TRUE], array $source)
void addAccessor ( $accessor_name, string $method_name)
int count ()
void escMySQL ( $key, [ $conn = null])
void escPgSQL ( $key, [ $conn = null])
void escPgSQLBytea ( $key, [ $conn = null])
mixed getAlnum (mixed $key)
mixed getAlpha (mixed $key)
mixed getDigits (mixed $key)
mixed getDir (mixed $key)
HTMLPurifier getHTMLPurifier ()
int getInt (mixed $key)
ArrayIterator getIterator ()
mixed getPath (mixed $key)
mixed getPurifiedHTML (string $key)
mixed getRaw (string $key)
mixed getROT13 (string $key)
mixed keyExists (mixed $key, [boolean $return_value = false])
void loadHTMLPurifier ([string $path = null], [ $opts = null])
mixed noPath (mixed $key)
mixed noTags (mixed $key)
void noTagsOrSpecial ( $key)
bool offsetExists (mixed $offset)
void offsetGet (mixed $offset)
void offsetSet (mixed $offset, mixed $value)
void offsetUnset (mixed $offset)
void setHTMLPurifier (HTMLPurifer $pobj)
mixed testAlnum (mixed $key)
mixed testAlpha (mixed $key)
mixed testBetween (mixed $key, mixed $min, mixed $max, [boolean $inc = TRUE])
mixed testCcnum (mixed $key, [mixed $type = NULL])
mixed testDate (mixed $key)
mixed testDigits (mixed $key)
mixed testEmail (mixed $key)
mixed testFloat (mixed $key)
mixed testGreaterThan (mixed $key, [mixed $min = NULL])
mixed testHex (mixed $key)
mixed testHostname (mixed $key, [integer $allow = ISPK_HOST_ALLOW_ALL])
mixed testInt (mixed $key)
mixed testIp (mixed $key)
mixed testLessThan (mixed $key, [mixed $max = NULL])
mixed testOneOf (mixed $key, [ $allowed = NULL])
mixed testPhone (mixed $key, [ $country = 'US'])
mixed testRegex (mixed $key, [mixed $pattern = NULL])
unknown testUri (unknown_type $key)
mixed testZip (mixed $key)
void _buildHTMLPurifierConfig ( $opts)
mixed _getValue (string $key)
void _getValueRecursive ( $keys,  $data_array, [ $level = 0])
void _keyExistsRecursive ( $keys,  $data_array)
void _parseAndApplyAutoFilters ( $conf_file,  $conf_section)
mixed _setValue (mixed $key, mixed $val)
void _setValueRecursive ( $keys,  $val,  $data_array, [ $level = 0])
void __call ( $name,  $args)
Variables
HTMLPurifer $purifier = NULL (line 54)
  • access: public
array $_autofilter_conf = NULL (line 48)

the holding property for autofilter config

  • access: public
array $_source = NULL (line 34)

Don't try to access this. ever. Now that we're safely on PHP5, we'll enforce this with the "protected" keyword.

  • access: protected
array $_user_accessors = array() (line 41)

where we store user-defined methods

  • access: public
Methods
static method Factory (line 80)

Takes an array and wraps it inside an object. If $strict is not set to FALSE, the original array will be destroyed, and the data can only be accessed via the object's accessor methods

  • access: public
static Inspekt_Cage Factory ( &$source, [string $conf_file = NULL], [string $conf_section = NULL], [boolean $strict = TRUE], array $source)
  • array $source
  • string $conf_file
  • string $conf_section
  • boolean $strict
  • &$source

Redefined in descendants as:
Constructor Inspekt_Cage (line 61)
  • access: public
Inspekt_Cage Inspekt_Cage ()
addAccessor (line 318)

This method lets the developer add new accessor methods to a cage object Note that calling these will be quite a bit slower, because we have to use call_user_func()

The dev needs to define a procedural function like so:

  1.  function foo_bar($cage_object$arg2$arg3$arg4$arg5...{
  2.     ...
  3.  }

  • author: Ed Finkler
  • access: public
void addAccessor ( $accessor_name, string $method_name)
  • string $method_name
  • $accessor_name
count (line 178)

Returns the number of elements in $this->_source.

  • access: public
int count ()

Implementation of:
Countable::count
escMySQL (line 896)
  • access: public
void escMySQL ( $key, [ $conn = null])
  • $key
  • $conn
escPgSQL (line 909)
  • access: public
void escPgSQL ( $key, [ $conn = null])
  • $key
  • $conn
escPgSQLBytea (line 922)
  • access: public
void escPgSQLBytea ( $key, [ $conn = null])
  • $key
  • $conn
getAlnum (line 346)

Returns only the alphabetic characters and digits in value.

  • tag: filter
  • access: public
mixed getAlnum (mixed $key)
  • mixed $key
getAlpha (line 331)

Returns only the alphabetic characters in value.

  • tag: filter
  • access: public
mixed getAlpha (mixed $key)
  • mixed $key
getDigits (line 361)

Returns only the digits in value. This differs from getInt().

  • tag: filter
  • access: public
mixed getDigits (mixed $key)
  • mixed $key
getDir (line 376)

Returns dirname(value).

  • tag: filter
  • access: public
mixed getDir (mixed $key)
  • mixed $key
getHTMLPurifier (line 215)
  • access: public
HTMLPurifier getHTMLPurifier ()
getInt (line 391)

Returns (int) value.

  • tag: filter
  • access: public
int getInt (mixed $key)
  • mixed $key
getIterator (line 117)

Returns an iterator for looping through an ArrayObject.

  • access: public
ArrayIterator getIterator ()

Implementation of:
IteratorAggregate::getIterator
getPath (line 406)

Returns realpath(value).

  • tag: filter
  • access: public
mixed getPath (mixed $key)
  • mixed $key
getPurifiedHTML (line 437)

This returns the value of the given key passed through the HTMLPurifer object, if it is instantiated with Inspekt_Cage::loadHTMLPurifer

  • return: purified HTML version of input
  • tag: filter
  • access: public
mixed getPurifiedHTML (string $key)
  • string $key
getRaw (line 463)

Returns value.

  • tag: filter
  • access: public
mixed getRaw (string $key)
  • string $key
getROT13 (line 421)

Returns ROT13-encoded version

  • tag: hash
  • access: public
mixed getROT13 (string $key)
  • string $key
keyExists (line 946)

Checks if a key exists

  • access: public
mixed keyExists (mixed $key, [boolean $return_value = false])
  • mixed $key
  • boolean $return_value: whether or not to return the value if key exists. defaults to FALSE.
loadHTMLPurifier (line 187)

Load the HTMLPurifier library and instantiate the object

  • access: public
void loadHTMLPurifier ([string $path = null], [ $opts = null])
  • string $path: the full path to the HTMLPurifier.auto.php base file. Optional if HTMLPurifier is already in your include_path
  • $opts
noPath (line 879)

Returns basename(value).

  • tag: filter
  • access: public
mixed noPath (mixed $key)
  • mixed $key
noTags (line 864)

Returns value with all tags removed.

  • tag: filter
  • access: public
mixed noTags (mixed $key)
  • mixed $key
noTagsOrSpecial (line 887)
  • access: public
void noTagsOrSpecial ( $key)
  • $key
offsetExists (line 143)

Returns whether the $offset exists in $this->_source.

  • access: public
bool offsetExists (mixed $offset)
  • mixed $offset

Implementation of:
ArrayAccess::offsetExists
offsetGet (line 167)

Returns the value at $offset from $this->_source.

  • access: public
void offsetGet (mixed $offset)
  • mixed $offset

Implementation of:
ArrayAccess::offsetGet
offsetSet (line 131)

Sets the value at the specified $offset to value$ in $this->_source.

  • access: public
void offsetSet (mixed $offset, mixed $value)
  • mixed $offset
  • mixed $value

Implementation of:
ArrayAccess::offsetSet
offsetUnset (line 155)

Unsets the value in $this->_source at $offset.

  • access: public
void offsetUnset (mixed $offset)
  • mixed $offset

Implementation of:
ArrayAccess::offsetUnset
setHTMLPurifier (line 208)
  • access: public
void setHTMLPurifier (HTMLPurifer $pobj)
  • HTMLPurifer $pobj: an HTMLPurifer Object
testAlnum (line 479)

Returns value if every character is alphabetic or a digit, FALSE otherwise.

  • tag: validator
  • access: public
mixed testAlnum (mixed $key)
  • mixed $key
testAlpha (line 499)

Returns value if every character is alphabetic, FALSE otherwise.

  • tag: validator
  • access: public
mixed testAlpha (mixed $key)
  • mixed $key
testBetween (line 524)

Returns value if it is greater than or equal to $min and less than or equal to $max, FALSE otherwise. If $inc is set to FALSE, then the value must be strictly greater than $min and strictly less than $max.

  • tag: validator
  • access: public
mixed testBetween (mixed $key, mixed $min, mixed $max, [boolean $inc = TRUE])
  • mixed $key
  • mixed $min
  • mixed $max
  • boolean $inc
testCcnum (line 546)

Returns value if it is a valid credit card number format. The optional second argument allows developers to indicate the type.

  • tag: validator
  • access: public
mixed testCcnum (mixed $key, [mixed $type = NULL])
  • mixed $key
  • mixed $type
testDate (line 566)

Returns $value if it is a valid date, FALSE otherwise. The date is required to be in ISO 8601 format.

  • tag: validator
  • access: public
mixed testDate (mixed $key)
  • mixed $key
testDigits (line 586)

Returns value if every character is a digit, FALSE otherwise.

This is just like isInt(), except there is no upper limit.

  • tag: validator
  • access: public
mixed testDigits (mixed $key)
  • mixed $key
testEmail (line 605)

Returns value if it is a valid email format, FALSE otherwise.

  • tag: validator
  • access: public
mixed testEmail (mixed $key)
  • mixed $key
testFloat (line 624)

Returns value if it is a valid float value, FALSE otherwise.

  • tag: validator
  • access: public
mixed testFloat (mixed $key)
  • mixed $key
testGreaterThan (line 644)

Returns value if it is greater than $min, FALSE otherwise.

  • tag: validator
  • access: public
mixed testGreaterThan (mixed $key, [mixed $min = NULL])
  • mixed $key
  • mixed $min
testHex (line 664)

Returns value if it is a valid hexadecimal format, FALSE otherwise.

  • tag: validator
  • access: public
mixed testHex (mixed $key)
  • mixed $key
testHostname (line 688)

Returns value if it is a valid hostname, FALSE otherwise.

Depending upon the value of $allow, Internet domain names, IP addresses, and/or local network names are considered valid. The default is HOST_ALLOW_ALL, which considers all of the above to be valid.

  • tag: validator
  • access: public
mixed testHostname (mixed $key, [integer $allow = ISPK_HOST_ALLOW_ALL])
  • mixed $key
  • integer $allow: bitfield for HOST_ALLOW_DNS, HOST_ALLOW_IP, HOST_ALLOW_LOCAL
testInt (line 707)

Returns value if it is a valid integer value, FALSE otherwise.

  • tag: validator
  • access: public
mixed testInt (mixed $key)
  • mixed $key
testIp (line 726)

Returns value if it is a valid IP format, FALSE otherwise.

  • tag: validator
  • access: public
mixed testIp (mixed $key)
  • mixed $key
testLessThan (line 746)

Returns value if it is less than $max, FALSE otherwise.

  • tag: validator
  • access: public
mixed testLessThan (mixed $key, [mixed $max = NULL])
  • mixed $key
  • mixed $max
testOneOf (line 765)

Returns value if it is one of $allowed, FALSE otherwise.

  • tag: validator
  • access: public
mixed testOneOf (mixed $key, [ $allowed = NULL])
  • mixed $key
  • $allowed
testPhone (line 785)

Returns value if it is a valid phone number format, FALSE otherwise. The optional second argument indicates the country.

  • tag: validator
  • access: public
mixed testPhone (mixed $key, [ $country = 'US'])
  • mixed $key
  • $country
testRegex (line 806)

Returns value if it matches $pattern, FALSE otherwise. Uses preg_match() for the matching.

  • tag: validator
  • access: public
mixed testRegex (mixed $key, [mixed $pattern = NULL])
  • mixed $key
  • mixed $pattern
testUri (line 826)

Enter description here...

  • tag: validator
  • access: public
unknown testUri (unknown_type $key)
  • unknown_type $key
testZip (line 845)

Returns value if it is a valid US ZIP, FALSE otherwise.

  • tag: validator
  • access: public
mixed testZip (mixed $key)
  • mixed $key
_applyAutoFilters (line 245)
  • access: protected
void _applyAutoFilters ()
_buildHTMLPurifierConfig (line 220)
  • access: protected
void _buildHTMLPurifierConfig ( $opts)
  • $opts
_getValue (line 995)

Retrieves a value from the _source array. This should NOT be called directly, but needs to be public for use by AccessorAbstract. Maybe a different approach should be considered

  • private:
  • access: public
mixed _getValue (string $key)
  • string $key
_getValueRecursive (line 1007)
  • access: protected
void _getValueRecursive ( $keys,  $data_array, [ $level = 0])
  • $keys
  • $data_array
  • $level
_keyExistsRecursive (line 967)
  • access: protected
void _keyExistsRecursive ( $keys,  $data_array)
  • $keys
  • $data_array
_parseAndApplyAutoFilters (line 229)
  • access: protected
void _parseAndApplyAutoFilters ( $conf_file,  $conf_section)
  • $conf_file
  • $conf_section
_setValue (line 1040)

Sets a value in the _source array

  • access: protected
mixed _setValue (mixed $key, mixed $val)
  • mixed $key
  • mixed $val
_setValueRecursive (line 1052)
  • access: protected
void _setValueRecursive ( $keys,  $val,  $data_array, [ $level = 0])
  • $keys
  • $val
  • $data_array
  • $level
__call (line 285)
  • access: public
void __call ( $name,  $args)
  • $name
  • $args

Documentation generated on Fri, 15 Jan 2010 10:43:51 -0500 by phpDocumentor 1.4.3