PHP 클래스 JBZoo\Utils\Ser

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

공개 메소드들

메소드 설명
fix ( string $brokenSerializedData ) : string Unserializes partially-corrupted arrays that occur sometimes. Addresses specifically the unserialize(): Error at offset xxx of yyy bytes error.
is ( mixed $data ) : boolean Check value to find if it was serialized.
maybe ( mixed $data ) : mixed Serialize data, if needed.
maybeUn ( string $data ) : mixed Unserialize value only if it is serialized.

보호된 메소드들

메소드 설명
_checkBasic ( string $data, integer $length ) : boolean Check some basic requirements of all serialized strings

메소드 상세

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

Check some basic requirements of all serialized strings
protected static _checkBasic ( string $data, integer $length ) : boolean
$data string
$length integer
리턴 boolean

fix() 공개 정적인 메소드

NOTE: This error can *frequently* occur with mismatched character sets and higher-than-ASCII characters. Contributed by Theodore R. Smith of PHP Experts, Inc.
public static fix ( string $brokenSerializedData ) : string
$brokenSerializedData string
리턴 string

is() 공개 정적인 메소드

If $data is not an string, then returned value will always be false. Serialized data is always a string.
public static is ( mixed $data ) : boolean
$data mixed Value to check to see if was serialized
리턴 boolean

maybe() 공개 정적인 메소드

Serialize data, if needed.
public static maybe ( mixed $data ) : mixed
$data mixed Data that might need to be serialized
리턴 mixed

maybeUn() 공개 정적인 메소드

Unserialize value only if it is serialized.
public static maybeUn ( string $data ) : mixed
$data string A variable that may or may not be serialized
리턴 mixed