PHP Класс XML_Unserializer

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$_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