PHP 클래스 Inspekt\Inspekt

파일 보기 프로젝트 열기: funkatron/inspekt 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$useFilterExtension

공개 메소드들

메소드 설명
convertArrayToArrayObject ( &$arr ) : ArrayObject Converts an array into an ArrayObject. We use ArrayObjects when walking arrays in Inspekt
escMySQL ( string $value, resource $conn ) : mixed Escapes the value given with mysql_real_escape_string
escPgSQL ( mixed $value, resource $conn = null ) : mixed Escapes the value given with pg_escape_string
escPgSQLBytea ( mixed $value, resource $conn = null ) : mixed Escapes the value given with pg_escape_bytea
getAlnum ( mixed $value ) : mixed Returns only the alphabetic characters and digits in value.
getAlpha ( mixed $value ) : mixed Returns only the alphabetic characters in value.
getDigits ( mixed $value ) : mixed Returns only the digits in value.
getDir ( mixed $value ) : mixed Returns dirname(value).
getInt ( mixed $value ) : integer Returns (int) value.
getPath ( mixed $value ) : mixed Returns realpath(value).
getROT13 ( mixed $value ) : mixed Returns the value encoded as ROT13 (or decoded, if already was ROT13)
isAlnum ( mixed $value ) : boolean Returns true if every character is alphabetic or a digit, false otherwise.
isAlpha ( mixed $value ) : boolean Returns true if every character is alphabetic, false otherwise.
isArrayObject ( $obj ) : boolean Checks to see if this is an ArrayObject
isArrayOrArrayObject ( $arr ) : boolean Checks to see if this is an array or an ArrayObject
isBetween ( mixed $value, mixed $min, mixed $max, boolean $inc = true ) : boolean 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.
isCcnum ( mixed $value, mixed $type = null ) : boolean Returns true if it is a valid credit card number format. The optional second argument allows developers to indicate the type.
isDate ( mixed $value ) : boolean Returns true if value is a valid date, false otherwise. The date is required to be in ISO 8601 format.
isDigits ( mixed $value ) : boolean Returns true if every character is a digit, false otherwise.
isEmail ( string $value ) : boolean Returns true if value is a valid email format, false otherwise.
isFloat ( string $value ) : boolean Returns true if value is a valid float value, false otherwise.
isGreaterThan ( mixed $value, mixed $min ) : boolean Returns true if value is greater than $min, false otherwise.
isHex ( mixed $value ) : boolean Returns true if value is a valid hexadecimal format, false otherwise.
isHostname ( mixed $value, integer $allow = self::ISPK_HOST_ALLOW_ALL ) : boolean Returns true if value is a valid hostname, false otherwise.
isInt ( string | array $value ) : boolean Returns true if value is a valid integer value, false otherwise.
isIp ( mixed $value ) : boolean Returns true if value is a valid IPV4 format, false otherwise.
isLessThan ( mixed $value, mixed $max ) : boolean Returns true if value is less than $max, false otherwise.
isOneOf ( mixed $value, array | string $allowed ) : boolean Returns true if value is one of $allowed, false otherwise.
isPhone ( mixed $value, string $country = 'US' ) : boolean Returns true if value is a valid phone number format, false otherwise. The optional second argument indicates the country.
isRegex ( mixed $value, mixed $pattern ) : mixed Returns true if value matches $pattern, false otherwise. Uses preg_match() for the matching.
isUri ( string $value, integer $mode = self::ISPK_URI_ALLOW_COMMON ) : boolean Enter description here.
isZip ( mixed $value ) : boolean Returns true if value is a valid US ZIP, false otherwise.
makeCookieCage ( string $config_file = null, boolean $strict = true ) : Cage Returns the $_COOKIE data wrapped in an Cage object
makeEnvCage ( string $config_file = null, boolean $strict = true ) : Cage Returns the $_ENV data wrapped in an Cage object
makeFilesCage ( string $config_file = null, boolean $strict = true ) : Cage Returns the $_FILES data wrapped in an Cage object
makeGetCage ( string $config_file = null, boolean $strict = true ) : Cage Returns the $_GET data wrapped in an Cage object
makePostCage ( string $config_file = null, boolean $strict = true ) : Cage Returns the $_POST data wrapped in an Cage object
makeServerCage ( string $config_file = null, boolean $strict = true ) : Cage Returns the $_SERVER data wrapped in an Cage object
makeSuperCage ( string $config_file = null, boolean $strict = true ) : SuperglobalsCage Returns a SuperglobalsCage object, which wraps ALL input superglobals
noPath ( mixed $value ) : mixed Returns basename(value).
noTags ( mixed $value ) : mixed Returns value with all tags removed.
noTagsOrSpecial ( mixed $value ) : array | mixed | string returns value with tags stripped and the chars '"&<> and all ascii chars under 32 encoded as html entities
useFilterExt ( boolean $state = null ) : boolean 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

보호된 메소드들

메소드 설명
walkArray ( array | ArrayObjec\ArrayObject $input, string $method, string | null $classname = null ) : array Recursively walks an array and applies a given filter method to every value in the array.

메소드 상세

convertArrayToArrayObject() 공개 정적인 메소드

Converts an array into an ArrayObject. We use ArrayObjects when walking arrays in Inspekt
public static convertArrayToArrayObject ( &$arr ) : ArrayObject
리턴 ArrayObject

escMySQL() 공개 정적인 메소드

Escapes the value given with mysql_real_escape_string
public static escMySQL ( string $value, resource $conn ) : mixed
$value string
$conn resource the mysql connection. If none is given, it will use the last link opened, per behavior of mysql_real_escape_string
리턴 mixed

escPgSQL() 공개 정적인 메소드

If the data is for a column of the type bytea, use Inspekt::escPgSQLBytea()
public static escPgSQL ( mixed $value, resource $conn = null ) : mixed
$value mixed
$conn resource the postgresql connection. If none is given, it will use the last link opened, per behavior of pg_escape_string
리턴 mixed

escPgSQLBytea() 공개 정적인 메소드

Escapes the value given with pg_escape_bytea
public static escPgSQLBytea ( mixed $value, resource $conn = null ) : mixed
$value mixed
$conn resource the postgresql connection. If none is given, it will use the last link opened, per behavior of pg_escape_bytea
리턴 mixed

getAlnum() 공개 정적인 메소드

Returns only the alphabetic characters and digits in value.
public static getAlnum ( mixed $value ) : mixed
$value mixed
리턴 mixed

getAlpha() 공개 정적인 메소드

Returns only the alphabetic characters in value.
public static getAlpha ( mixed $value ) : mixed
$value mixed
리턴 mixed

getDigits() 공개 정적인 메소드

Returns only the digits in value.
public static getDigits ( mixed $value ) : mixed
$value mixed
리턴 mixed

getDir() 공개 정적인 메소드

Returns dirname(value).
public static getDir ( mixed $value ) : mixed
$value mixed
리턴 mixed

getInt() 공개 정적인 메소드

Returns (int) value.
public static getInt ( mixed $value ) : integer
$value mixed
리턴 integer

getPath() 공개 정적인 메소드

Returns realpath(value).
public static getPath ( mixed $value ) : mixed
$value mixed
리턴 mixed

getROT13() 공개 정적인 메소드

Returns the value encoded as ROT13 (or decoded, if already was ROT13)
public static getROT13 ( mixed $value ) : mixed
$value mixed
리턴 mixed

isAlnum() 공개 정적인 메소드

Returns true if every character is alphabetic or a digit, false otherwise.
public static isAlnum ( mixed $value ) : boolean
$value mixed
리턴 boolean

isAlpha() 공개 정적인 메소드

Returns true if every character is alphabetic, false otherwise.
public static isAlpha ( mixed $value ) : boolean
$value mixed
리턴 boolean

isArrayObject() 공개 정적인 메소드

Checks to see if this is an ArrayObject
사용 중단:
public static isArrayObject ( $obj ) : boolean
리턴 boolean

isArrayOrArrayObject() 공개 정적인 메소드

Checks to see if this is an array or an ArrayObject
public static isArrayOrArrayObject ( $arr ) : boolean
리턴 boolean

isBetween() 공개 정적인 메소드

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.
public static isBetween ( mixed $value, mixed $min, mixed $max, boolean $inc = true ) : boolean
$value mixed
$min mixed
$max mixed
$inc boolean
리턴 boolean

isCcnum() 공개 정적인 메소드

Returns true if it is a valid credit card number format. The optional second argument allows developers to indicate the type.
public static isCcnum ( mixed $value, mixed $type = null ) : boolean
$value mixed
$type mixed
리턴 boolean

isDate() 공개 정적인 메소드

Returns true if value is a valid date, false otherwise. The date is required to be in ISO 8601 format.
public static isDate ( mixed $value ) : boolean
$value mixed
리턴 boolean

isDigits() 공개 정적인 메소드

This is just like isInt(), except there is no upper limit.
public static isDigits ( mixed $value ) : boolean
$value mixed
리턴 boolean

isEmail() 공개 정적인 메소드

Returns true if value is a valid email format, false otherwise.
또한 보기: http://www.regular-expressions.info/email.html
또한 보기: self::ISPK_EMAIL_VALID
public static isEmail ( string $value ) : boolean
$value string
리턴 boolean

isFloat() 공개 정적인 메소드

Returns true if value is a valid float value, false otherwise.
public static isFloat ( string $value ) : boolean
$value string
리턴 boolean

isGreaterThan() 공개 정적인 메소드

Returns true if value is greater than $min, false otherwise.
public static isGreaterThan ( mixed $value, mixed $min ) : boolean
$value mixed
$min mixed
리턴 boolean

isHex() 공개 정적인 메소드

Returns true if value is a valid hexadecimal format, false otherwise.
public static isHex ( mixed $value ) : boolean
$value mixed
리턴 boolean

isHostname() 공개 정적인 메소드

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.
public static isHostname ( mixed $value, integer $allow = self::ISPK_HOST_ALLOW_ALL ) : boolean
$value mixed
$allow integer bitfield for self::ISPK_HOST_ALLOW_DNS, self::ISPK_HOST_ALLOW_IP, self::ISPK_HOST_ALLOW_LOCAL
리턴 boolean

isInt() 공개 정적인 메소드

Returns true if value is a valid integer value, false otherwise.
public static isInt ( string | array $value ) : boolean
$value string | array
리턴 boolean

isIp() 공개 정적인 메소드

Returns true if value is a valid IPV4 format, false otherwise.
public static isIp ( mixed $value ) : boolean
$value mixed
리턴 boolean

isLessThan() 공개 정적인 메소드

Returns true if value is less than $max, false otherwise.
public static isLessThan ( mixed $value, mixed $max ) : boolean
$value mixed
$max mixed
리턴 boolean

isOneOf() 공개 정적인 메소드

Returns true if value is one of $allowed, false otherwise.
public static isOneOf ( mixed $value, array | string $allowed ) : boolean
$value mixed
$allowed array | string
리턴 boolean

isPhone() 공개 정적인 메소드

This method requires that the value consist of only digits.
public static isPhone ( mixed $value, string $country = 'US' ) : boolean
$value mixed
$country string
리턴 boolean

isRegex() 공개 정적인 메소드

Returns true if value matches $pattern, false otherwise. Uses preg_match() for the matching.
public static isRegex ( mixed $value, mixed $pattern ) : mixed
$value mixed
$pattern mixed
리턴 mixed

isUri() 공개 정적인 메소드

..
public static isUri ( string $value, integer $mode = self::ISPK_URI_ALLOW_COMMON ) : boolean
$value string
$mode integer
리턴 boolean

isZip() 공개 정적인 메소드

Returns true if value is a valid US ZIP, false otherwise.
public static isZip ( mixed $value ) : boolean
$value mixed
리턴 boolean

makeCookieCage() 공개 정적인 메소드

This utilizes a singleton pattern to get around scoping issues
public static makeCookieCage ( string $config_file = null, boolean $strict = true ) : Cage
$config_file string
$strict boolean whether or not to nullify the superglobal array
리턴 Cage

makeEnvCage() 공개 정적인 메소드

This utilizes a singleton pattern to get around scoping issues
public static makeEnvCage ( string $config_file = null, boolean $strict = true ) : Cage
$config_file string
$strict boolean whether or not to nullify the superglobal array
리턴 Cage

makeFilesCage() 공개 정적인 메소드

This utilizes a singleton pattern to get around scoping issues
public static makeFilesCage ( string $config_file = null, boolean $strict = true ) : Cage
$config_file string
$strict boolean whether or not to nullify the superglobal array
리턴 Cage

makeGetCage() 공개 정적인 메소드

This utilizes a singleton pattern to get around scoping issues
public static makeGetCage ( string $config_file = null, boolean $strict = true ) : Cage
$config_file string
$strict boolean whether or not to nullify the superglobal array
리턴 Cage

makePostCage() 공개 정적인 메소드

This utilizes a singleton pattern to get around scoping issues
public static makePostCage ( string $config_file = null, boolean $strict = true ) : Cage
$config_file string
$strict boolean whether or not to nullify the superglobal array
리턴 Cage

makeServerCage() 공개 정적인 메소드

This utilizes a singleton pattern to get around scoping issues
public static makeServerCage ( string $config_file = null, boolean $strict = true ) : Cage
$config_file string
$strict boolean whether or not to nullify the superglobal array
리턴 Cage

makeSuperCage() 공개 정적인 메소드

Returns a SuperglobalsCage object, which wraps ALL input superglobals
public static makeSuperCage ( string $config_file = null, boolean $strict = true ) : SuperglobalsCage
$config_file string
$strict boolean whether or not to nullify the superglobal
리턴 SuperglobalsCage

noPath() 공개 정적인 메소드

Returns basename(value).
public static noPath ( mixed $value ) : mixed
$value mixed
리턴 mixed

noTags() 공개 정적인 메소드

This will utilize the PHP Filter extension if available
public static noTags ( mixed $value ) : mixed
$value mixed
리턴 mixed

noTagsOrSpecial() 공개 정적인 메소드

This will utilize the PHP Filter extension if available
public static noTagsOrSpecial ( mixed $value ) : array | mixed | string
$value mixed
리턴 array | mixed | string @mixed

useFilterExt() 공개 정적인 메소드

We use this method of storing in a static class property so that we can access the value outside of class instances
public static useFilterExt ( boolean $state = null ) : boolean
$state boolean optional
리턴 boolean

walkArray() 보호된 정적인 메소드

This should be considered a "protected" method, and not be called outside of the class
protected static walkArray ( array | ArrayObjec\ArrayObject $input, string $method, string | null $classname = null ) : array
$input array | ArrayObjec\ArrayObject
$method string
$classname string | null
리턴 array

프로퍼티 상세

$useFilterExtension 보호되어 있는 정적으로 프로퍼티

protected static $useFilterExtension