PHP 클래스 XML_Unserializer

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

공개 프로퍼티들

프로퍼티 타입 설명
$_dataStack array stack for all data that is found
$_defaultOptions array default options for the serialization
$_depth integer current tag depth
$_knownOptions array list of all available options
$_parser XML_Parser instance
$_root string name of the root tag
$_unserializedData string unserialized data
$_valStack array stack for all values that are generated
$options array current options for the serialization

공개 메소드들

메소드 설명
XML_Unserializer ( mixed $options = null ) constructor
_createParser ( ) : boolean create the XML_Parser instance
_getComplexType ( string $tagname ) : string get the complex type, that should be used for a specified tag
_guessAndSetType ( string $value ) : mixed Try to guess the type of a value and set it accordingly
_guessAndSetTypes ( array $array ) : array Try to guess the type of several values and set them accordingly
apiVersion ( ) : string return API version
cdataHandler ( object $parser, string $cdata ) : void Handler for character data
endHandler ( object $parser, string $element ) : void End element handler for XML parser
getRootName ( ) : string get the name of the root tag
getUnserializedData ( ) : string get the result of the serialization
resetOptions ( ) : void reset all options to default options
setOption ( string $name, mixed $value ) : void set an option
setOptions ( array $options ) : void sets several options at once
startHandler ( object $parser, string $element, array $attribs ) : void Start element handler for XML parser
unserialize ( mixed $data, boolean $isFile = false, array $options = null ) : boolean unserialize data

메소드 상세

XML_Unserializer() 공개 메소드

constructor
public XML_Unserializer ( mixed $options = null )
$options mixed array containing options for the unserialization

_createParser() 공개 메소드

create the XML_Parser instance
public _createParser ( ) : boolean
리턴 boolean

_getComplexType() 공개 메소드

get the complex type, that should be used for a specified tag
public _getComplexType ( string $tagname ) : string
$tagname string name of the tag
리턴 string complex type ('array' or 'object')

_guessAndSetType() 공개 메소드

Try to guess the type of a value and set it accordingly
public _guessAndSetType ( string $value ) : mixed
$value string character data
리턴 mixed value with the best matching type

_guessAndSetTypes() 공개 메소드

Try to guess the type of several values and set them accordingly
public _guessAndSetTypes ( array $array ) : array
$array array array containing the values
리턴 array array, containing the values with their correct types

apiVersion() 공개 메소드

return API version
public apiVersion ( ) : string
리턴 string $version API version

cdataHandler() 공개 메소드

Handler for character data
public cdataHandler ( object $parser, string $cdata ) : void
$parser object XML parser object
$cdata string CDATA
리턴 void

endHandler() 공개 메소드

End element handler for XML parser
public endHandler ( object $parser, string $element ) : void
$parser object XML parser object
$element string element
리턴 void

getRootName() 공개 메소드

get the name of the root tag
public getRootName ( ) : string
리턴 string $rootName

getUnserializedData() 공개 메소드

get the result of the serialization
public getUnserializedData ( ) : string
리턴 string $serializedData

resetOptions() 공개 메소드

reset all options to default options
public resetOptions ( ) : void
리턴 void

setOption() 공개 메소드

You can use this method if you do not want to set all options in the constructor
public setOption ( string $name, mixed $value ) : void
$name string name of option
$value mixed value of option
리턴 void

setOptions() 공개 메소드

You can use this method if you do not want to set all options in the constructor
public setOptions ( array $options ) : void
$options array options array
리턴 void

startHandler() 공개 메소드

Start element handler for XML parser
public startHandler ( object $parser, string $element, array $attribs ) : void
$parser object XML parser object
$element string XML element
$attribs array attributes of XML tag
리턴 void

unserialize() 공개 메소드

unserialize data
public unserialize ( mixed $data, boolean $isFile = false, array $options = null ) : boolean
$data mixed data to unserialize (string, filename or resource)
$isFile boolean data should be treated as a file
$options array options that will override the global options for this call
리턴 boolean $success

프로퍼티 상세

$_dataStack 공개적으로 프로퍼티

stack for all data that is found
public array $_dataStack
리턴 array

$_defaultOptions 공개적으로 프로퍼티

default options for the serialization
public array $_defaultOptions
리턴 array

$_depth 공개적으로 프로퍼티

current tag depth
public int $_depth
리턴 integer

$_knownOptions 공개적으로 프로퍼티

list of all available options
public array $_knownOptions
리턴 array

$_parser 공개적으로 프로퍼티

XML_Parser instance
public $_parser

$_root 공개적으로 프로퍼티

name of the root tag
public string $_root
리턴 string

$_unserializedData 공개적으로 프로퍼티

unserialized data
public string $_unserializedData
리턴 string

$_valStack 공개적으로 프로퍼티

stack for all values that are generated
public array $_valStack
리턴 array

$options 공개적으로 프로퍼티

current options for the serialization
public array $options
리턴 array