Class Inspekt

Description

Located in /Inspekt.php (line 95)


	
			
Variable Summary
static mixed $useFilterExtension
Method Summary
static ArrayObject convertArrayToArrayObject (array &$arr)
static mixed escMySQL (mixed $value, [resource $conn = null])
static mixed escPgSQL (mixed $value, [resource $conn = null])
static mixed escPgSQLBytea (mixed $value, [resource $conn = null])
static mixed getAlnum (mixed $value)
static mixed getAlpha (mixed $value)
static mixed getDigits (mixed $value)
static mixed getDir (mixed $value)
static int getInt (mixed $value)
static mixed getPath (mixed $value)
static mixed getROT13 (mixed $value)
static boolean isAlnum (mixed $value)
static boolean isAlpha (mixed $value)
static boolean isArrayObject (mixed $obj)
static boolean isArrayOrArrayObject (mixed $arr)
static boolean isBetween (mixed $value, mixed $min, mixed $max, [ $inc = TRUE])
static boolean isCcnum (mixed $value, [mixed $type = NULL])
static boolean isDate (mixed $value)
static boolean isDigits (mixed $value)
static boolean isEmail (string $value)
static boolean isFloat (string $value)
static boolean isGreaterThan (mixed $value, mixed $min)
static boolean isHex (mixed $value)
static boolean isHostname (mixed $value, [integer $allow = ISPK_HOST_ALLOW_ALL])
static boolean isInt (string|array $value)
static boolean isIp (mixed $value)
static boolean isLessThan (mixed $value, mixed $max)
static boolean isOneOf (mixed $value, array|string $allowed)
static boolean isPhone (mixed $value, [ $country = 'US'])
static mixed isRegex (mixed $value, mixed $pattern)
static boolean isUri (string $value, [integer $mode = ISPK_URI_ALLOW_COMMON])
static boolean isZip (mixed $value)
static Inspekt_Cage makeCookieCage ([string $config_file = NULL], [boolean $strict = TRUE])
static Inspekt_Cage makeEnvCage ([string $config_file = NULL], [boolean $strict = TRUE])
static Inspekt_Cage makeFilesCage ([string $config_file = NULL], [boolean $strict = TRUE])
static Inspekt_Cage makeGetCage ([string $config_file = NULL], [boolean $strict = TRUE])
static Inspekt_Cage makePostCage ([string $config_file = NULL], [boolean $strict = TRUE])
static Inspekt_Cage makeServerCage ([string $config_file = NULL], [boolean $strict = TRUE])
static Inspekt_Cage makeSessionCage ([string $config_file = NULL], [boolean $strict = TRUE])
static Inspekt_Supercage makeSuperCage ([string $config_file = NULL], [boolean $strict = TRUE])
static mixed noPath (mixed $value)
static mixed noTags (mixed $value)
static @mixed noTagsOrSpecial (mixed $value)
static boolean useFilterExt ([boolean $state = null])
static array _walkArray (array|ArrayObject $input,  $method, [ $classname = NULL], string $inspektor)
Variables
static mixed $useFilterExtension = true (line 99)
  • access: protected
Methods
static method convertArrayToArrayObject (line 391)

Converts an array into an ArrayObject. We use ArrayObjects when walking arrays in Inspekt

  • access: public
static ArrayObject convertArrayToArrayObject (array &$arr)
  • array &$arr
static method escMySQL (line 1221)

Escapes the value given with mysql_real_escape_string

static mixed escMySQL (mixed $value, [resource $conn = null])
  • mixed $value
  • resource $conn: the mysql connection. If none is given, it will use the last link opened, per behavior of mysql_real_escape_string
static method escPgSQL (line 1249)

Escapes the value given with pg_escape_string

If the data is for a column of the type bytea, use Inspekt::escPgSQLBytea()

static mixed escPgSQL (mixed $value, [resource $conn = null])
  • mixed $value
  • resource $conn: the postgresql connection. If none is given, it will use the last link opened, per behavior of pg_escape_string
static method escPgSQLBytea (line 1275)

Escapes the value given with pg_escape_bytea

static mixed escPgSQLBytea (mixed $value, [resource $conn = null])
  • mixed $value
  • resource $conn: the postgresql connection. If none is given, it will use the last link opened, per behavior of pg_escape_bytea
static method getAlnum (line 434)

Returns only the alphabetic characters and digits in value.

  • tag: filter
  • access: public
static mixed getAlnum (mixed $value)
  • mixed $value
static method getAlpha (line 414)

Returns only the alphabetic characters in value.

  • tag: filter
  • access: public
static mixed getAlpha (mixed $value)
  • mixed $value
static method getDigits (line 454)

Returns only the digits in value.

  • tag: filter
  • access: public
static mixed getDigits (mixed $value)
  • mixed $value
static method getDir (line 476)

Returns dirname(value).

  • tag: filter
  • access: public
static mixed getDir (mixed $value)
  • mixed $value
static method getInt (line 496)

Returns (int) value.

  • tag: filter
  • access: public
static int getInt (mixed $value)
  • mixed $value
static method getPath (line 513)

Returns realpath(value).

  • tag: filter
  • access: public
static mixed getPath (mixed $value)
  • mixed $value
static method getROT13 (line 531)

Returns the value encoded as ROT13 (or decoded, if already was ROT13)

static mixed getROT13 (mixed $value)
  • mixed $value
static method isAlnum (line 557)

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

  • tag: validator
  • access: public
static boolean isAlnum (mixed $value)
  • mixed $value
static method isAlpha (line 578)

Returns TRUE if every character is alphabetic, FALSE otherwise.

  • tag: validator
  • access: public
static boolean isAlpha (mixed $value)
  • mixed $value
static method isArrayObject (line 366)

Checks to see if this is an ArrayObject

static boolean isArrayObject (mixed $obj)
  • mixed $obj
static method isArrayOrArrayObject (line 379)

Checks to see if this is an array or an ArrayObject

static boolean isArrayOrArrayObject (mixed $arr)
  • mixed $arr
static method isBetween (line 603)

Returns TRUE if value 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
static boolean isBetween (mixed $value, mixed $min, mixed $max, [ $inc = TRUE])
  • mixed $value
  • mixed $min
  • mixed $max
  • $inc
static method isCcnum (line 630)

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

  • tag: validator
  • access: public
static boolean isCcnum (mixed $value, [mixed $type = NULL])
  • mixed $value
  • mixed $type
static method isDate (line 675)

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

  • tag: validator
  • access: public
static boolean isDate (mixed $value)
  • mixed $value
static method isDigits (line 695)

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

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

  • tag: validator
  • access: public
static boolean isDigits (mixed $value)
  • mixed $value
static method isEmail (line 717)

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

static boolean isEmail (string $value)
  • string $value
static method isFloat (line 734)

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

  • tag: validator
  • access: public
static boolean isFloat (string $value)
  • string $value
static method isGreaterThan (line 758)

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

  • tag: validator
  • access: public
static boolean isGreaterThan (mixed $value, mixed $min)
  • mixed $value
  • mixed $min
static method isHex (line 777)

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

  • tag: validator
  • access: public
static boolean isHex (mixed $value)
  • mixed $value
static method isHostname (line 796)

Returns TRUE if value 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
static boolean isHostname (mixed $value, [integer $allow = ISPK_HOST_ALLOW_ALL])
  • mixed $value
  • integer $allow: bitfield for ISPK_HOST_ALLOW_DNS, ISPK_HOST_ALLOW_IP, ISPK_HOST_ALLOW_LOCAL
static method isInt (line 862)

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

  • todo: better handling of diffs b/t 32-bit and 64-bit
  • tag: validator
  • access: public
static boolean isInt (string|array $value)
  • string|array $value
static method isIp (line 897)

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

  • tag: validator
  • access: public
static boolean isIp (mixed $value)
  • mixed $value
static method isLessThan (line 912)

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

  • tag: validator
  • access: public
static boolean isLessThan (mixed $value, mixed $max)
  • mixed $value
  • mixed $max
static method isOneOf (line 927)

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

  • tag: validator
  • access: public
static boolean isOneOf (mixed $value, array|string $allowed)
  • mixed $value
  • array|string $allowed
static method isPhone (line 953)

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

This method requires that the value consist of only digits.

  • tag: validator
  • access: public
static boolean isPhone (mixed $value, [ $country = 'US'])
  • mixed $value
  • $country
static method isRegex (line 1032)

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

  • tag: validator
  • access: public
static mixed isRegex (mixed $value, mixed $pattern)
  • mixed $value
  • mixed $pattern
static method isUri (line 1050)

Enter description here...

static boolean isUri (string $value, [integer $mode = ISPK_URI_ALLOW_COMMON])
  • string $value
  • integer $mode
static method isZip (line 1121)

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

  • tag: validator
  • access: public
static boolean isZip (mixed $value)
  • mixed $value
static method makeCookieCage (line 185)

Returns the $_COOKIE data wrapped in an Inspekt_Cage object

This utilizes a singleton pattern to get around scoping issues

  • access: public
static Inspekt_Cage makeCookieCage ([string $config_file = NULL], [boolean $strict = TRUE])
  • string $config_file
  • boolean $strict: whether or not to nullify the superglobal array
static method makeEnvCage (line 209)

Returns the $_ENV data wrapped in an Inspekt_Cage object

This utilizes a singleton pattern to get around scoping issues

  • access: public
static Inspekt_Cage makeEnvCage ([string $config_file = NULL], [boolean $strict = TRUE])
  • string $config_file
  • boolean $strict: whether or not to nullify the superglobal array
static method makeFilesCage (line 233)

Returns the $_FILES data wrapped in an Inspekt_Cage object

This utilizes a singleton pattern to get around scoping issues

  • access: public
static Inspekt_Cage makeFilesCage ([string $config_file = NULL], [boolean $strict = TRUE])
  • string $config_file
  • boolean $strict: whether or not to nullify the superglobal array
static method makeGetCage (line 138)

Returns the $_GET data wrapped in an Inspekt_Cage object

This utilizes a singleton pattern to get around scoping issues

  • access: public
static Inspekt_Cage makeGetCage ([string $config_file = NULL], [boolean $strict = TRUE])
  • string $config_file
  • boolean $strict: whether or not to nullify the superglobal array
static method makePostCage (line 162)

Returns the $_POST data wrapped in an Inspekt_Cage object

This utilizes a singleton pattern to get around scoping issues

  • access: public
static Inspekt_Cage makePostCage ([string $config_file = NULL], [boolean $strict = TRUE])
  • string $config_file
  • boolean $strict: whether or not to nullify the superglobal array
static method makeServerCage (line 114)

Returns the $_SERVER data wrapped in an Inspekt_Cage object

This utilizes a singleton pattern to get around scoping issues

  • access: public
static Inspekt_Cage makeServerCage ([string $config_file = NULL], [boolean $strict = TRUE])
  • string $config_file
  • boolean $strict: whether or not to nullify the superglobal array
static method makeSessionCage (line 258)

Returns the $_SESSION data wrapped in an Inspekt_Cage object

This utilizes a singleton pattern to get around scoping issues

  • deprecated:
  • access: public
static Inspekt_Cage makeSessionCage ([string $config_file = NULL], [boolean $strict = TRUE])
  • string $config_file
  • boolean $strict: whether or not to nullify the superglobal array
static method makeSuperCage (line 287)

Returns a Supercage object, which wraps ALL input superglobals

  • access: public
static Inspekt_Supercage makeSuperCage ([string $config_file = NULL], [boolean $strict = TRUE])
  • string $config_file
  • boolean $strict: whether or not to nullify the superglobal
static method noPath (line 1200)

Returns basename(value).

  • tag: filter
  • access: public
static mixed noPath (mixed $value)
  • mixed $value
static method noTags (line 1137)

Returns value with all tags removed.

This will utilize the PHP Filter extension if available

  • tag: filter
  • access: public
static mixed noTags (mixed $value)
  • mixed $value
static method noTagsOrSpecial (line 1161)

returns value with tags stripped and the chars '"&<> and all ascii chars under 32 encoded as html entities

This will utilize the PHP Filter extension if available

  • tag: filter
  • access: public
static @mixed noTagsOrSpecial (mixed $value)
  • mixed $value
static method useFilterExt (line 310)

Sets and/or retrieves whether we should use the PHP filter extensions where possible If a param is passed, it will set the state in addition to returning it

We use this method of storing in a static class property so that we can access the value outside of class instances

  • access: public
static boolean useFilterExt ([boolean $state = null])
  • boolean $state: optional
static method _walkArray (line 332)

Recursively walks an array and applies a given filter method to every value in the array.

This should be considered a "protected" method, and not be called outside of the class

  • access: protected
static array _walkArray (array|ArrayObject $input,  $method, [ $classname = NULL], string $inspektor)
  • array|ArrayObject $input
  • string $inspektor: The name of a static filtering method, like get* or no*
  • $method
  • $classname

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