link http://www.python.org
link http://pickle-js.googlecode.com
see
see
category Zend
package Zend_Serializer
subpackage Adapter
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Serializer_Adapter_AdapterAbstract

 Methods

Constructor

__construct(array|\Zend_Config $opts = array()
link Zend_Serializer_Adapter_AdapterAbstract::__construct()
inherited_from \Zend_Serializer_Adapter_AdapterAbstract::__construct()

Parameters

$opts

Constructor

__construct(array|\Zend_Config $opts = array()
Inherited
inherited_from \Zend_Serializer_Adapter_AdapterInterface::__construct()

Parameters

$opts

array\Zend_Config

Serializer options

Get a serializer option

getOption(string $name) : mixed
Inherited
inherited_from \Zend_Serializer_Adapter_AdapterInterface::getOption()

Parameters

$name

string

Exceptions

\Zend_Serializer_Exception

Returns

mixed

Get serializer options

getOptions() : array
Inherited
inherited_from \Zend_Serializer_Adapter_AdapterInterface::getOptions()

Returns

array

Serialize PHP to PythonPickle format

serialize(mixed $value, array $opts = array()) : string

Parameters

$value

mixed

$opts

array

Returns

string

Set an option

setOption(string $name, mixed $value) : \Zend_Serializer_Adapter_PythonPickle
link Zend_Serializer_Adapter_AdapterAbstract::setOption()
inherited_from \Zend_Serializer_Adapter_AdapterAbstract::setOption()

Parameters

$name

string

$value

mixed

Returns

\Zend_Serializer_Adapter_PythonPickle

Set a serializer option

setOption(string $name, mixed $value) : \Zend_Serializer_Adapter_AdapterAbstract
Inherited
inherited_from \Zend_Serializer_Adapter_AdapterInterface::setOption()

Parameters

$name

string

Option name

$value

mixed

Option value

Returns

\Zend_Serializer_Adapter_AdapterAbstract

Set serializer options

setOptions(array|\Zend_Config $opts) : \Zend_Serializer_Adapter_AdapterAbstract
Inherited
inherited_from \Zend_Serializer_Adapter_AdapterInterface::setOptions()

Parameters

$opts

array\Zend_Config

Serializer options

Returns

\Zend_Serializer_Adapter_AdapterAbstract

Unserialize from Python Pickle format to PHP

unserialize(string $pickle, array $opts = array()) : mixed

Parameters

$pickle

string

$opts

array

Exceptions

\Zend_Serializer_Exception on invalid Pickle string

Returns

mixed

Check and normalize pickle protocol number

_checkProtocolNumber(integer $number) : integer

Parameters

$number

integer

Exceptions

\Zend_Serializer_Exception

Returns

integer

Convert a unicode sequence to UTF-8

_convertMatchingUnicodeSequence2Utf8(array $match) : string

Parameters

$match

array

Returns

string

Decode a binary long sequence

_decodeBinLong(string $data) : integer | float | string

Parameters

$data

string

Returns

integerfloatstring

Convert a hex string to a UTF-8 string

_hex2Utf8($hex) : string

Parameters

$hex

Exceptions

\Zend_Serializer_Exception on unmatched unicode sequence

Returns

string

Is an array associative?

_isArrayAssoc(array $value) : boolean

Parameters

$value

array

Returns

boolean

Return last marker position in stack

_lastMarker() : integer

Returns

integer

Load a pickle opcode

_load(string $op) : void

Parameters

$op

string

Exceptions

\Zend_Serializer_Exception on invalid opcode

Load an append (to list) sequence

_loadAppend() : void

Load multiple append (to list) sequences at once

_loadAppends() : void

Load arbitrary binary bytes

_loadBinBytes() : void

Load a binary float value

_loadBinFloat() : void

Load a binary GET operation

_loadBinGet() : void

Exceptions

\Zend_Serializer_Exception on missing GET identifier

Load a binary integer operator

_loadBinInt() : void

Load the first byte of a binary integer

_loadBinInt1() : void

Load the second byte of a binary integer

_loadBinInt2() : void

Load a binary PUT

_loadBinPut() : void

Exceptions

\Zend_Serializer_Exception on missing stack

Load a binary string

_loadBinString() : void

Load binary unicode sequence

_loadBinUnicode() : void

Load an associative array (Python dictionary)

_loadDict() : void

Load an empty dictionary

_loadEmptyDict() : void

Load an empty list sequence

_loadEmptyList() : void

Load a float value

_loadFloat() : void

Load a GET operation

_loadGet() : void

Exceptions

\Zend_Serializer_Exception on missing GET identifier

Load an integer operator

_loadInt() : void

Load an array (list)

_loadList() : void

Load a long (float) operator

_loadLong() : void

Load a one byte long integer

_loadLong1() : void

Load a 4 byte long integer

_loadLong4() : void

Load a long binary GET operation

_loadLongBinGet() : void

Exceptions

\Zend_Serializer_Exception on missing GET identifier

Load a long binary PUT

_loadLongBinPut() : void

Exceptions

\Zend_Serializer_Exception on missing stack

Load a marker sequence

_loadMark() : void

Load a boolean FALSE operator

_loadNewFalse() : void

Load a boolean TRUE operator

_loadNewTrue() : void

Load a NONE operator

_loadNone() : void

Load a proto value

_loadProto() : void

Exceptions

\Zend_Serializer_Exception if Pickle version does not support this feature

Load a PUT opcode

_loadPut() : void

Exceptions

\Zend_Serializer_Exception on missing stack

Load an item from a set

_loadSetItem() : void

Load set items

_loadSetItems() : void

Load a single binary byte

_loadShortBinBytes() : void

Load a short binary string

_loadShortBinString() : void

Load a string

_loadString() : void

Load a tuple

_loadTuple() : void

Load single item tuple

_loadTuple1() : void

Load two item tuple

_loadTuple2() : void

Load three item tuple

_loadTuple3() : void

Load a unicode string

_loadUnicode() : void

Add a value to the memo and write the id

_momorize(mixed $value) : void

Parameters

$value

mixed

Quote/Escape a string

_quoteString(string $str) : string

Parameters

$str

string

Returns

stringquoted string

Read a segment of the pickle

_read(mixed $len) : string

Parameters

$len

mixed

Exceptions

\Zend_Serializer_Exception if position matches end of data

Returns

string

Read a line of the pickle at once

_readline() : string

Exceptions

\Zend_Serializer_Exception if no EOL character found

Returns

string

Search a value in the meno and return the id

_searchMomo(mixed $value) : integer | false

Parameters

$value

mixed

Returns

integerfalseThe id or false

Unquote/Unescape a quoted string

_unquoteString(string $str) : string

Parameters

$str

string

quoted string

Returns

stringunquoted string

Write a value

_write(mixed $value) : void

Parameters

$value

mixed

Exceptions

\Zend_Serializer_Exception on invalid or unrecognized value type

Write an associative array value as dictionary

_writeArrayDict(array $value) : void

Parameters

$value

array

Write a simple array value as list

_writeArrayList(array $value) : void

Parameters

$value

array

Write a boolean false

_writeFalse() : void

Write a float value

_writeFloat(float $value) : void

Parameters

$value

float

Write a get

_writeGet(integer $id) : void

Parameters

$id

integer

Id of memo

Write an integer value

_writeInt(integer $value) : void

Parameters

$value

integer

Write a null as None

_writeNull() : void

Write an object as an dictionary

_writeObject(object $value) : void

Parameters

$value

object

Write pickle protocol

_writeProto(integer $protocol) : void

Parameters

$protocol

integer

Write a put

_writePut(integer $id) : void

Parameters

$id

integer

Id of memo

Write stop

_writeStop() : void

Write a string value

_writeString(string $value) : void

Parameters

$value

string

Write a boolean true

_writeTrue() : void

 Properties

 

$_binary

$_binary 

Default

false
 

Whether or not the system is little-endian

$_isLittleEndian : boolean

Default

null
Static
 

$_marker

$_marker 

Default

null
 

$_memo

$_memo 

Default

array()
 

Serializer options

$_options : array

Default

array('protocol' => 0)
inherited_from \Zend_Serializer_Adapter_AdapterAbstract::_options
 

Serializer options

$_options : array

Default

array()
 

$_pickle

$_pickle 

Default

''
 

$_pickleLen

$_pickleLen 

Default

0
 

$_pos

$_pos 

Default

0
 

$_protocol

$_protocol 

Default

0
 

Strings representing quotes

$_quoteString : array

Default

array('\\' => '\\\\', "\x00" => '\\x00', "\x01" => '\\x01', "\x02" => '\\x02', "\x03" => '\\x03', "\x04" => '\\x04', "\x05" => '\\x05', "\x06" => '\\x06', "\x07" => '\\x07', "\x08" => '\\x08', "\x09" => '\\t', "\x0a" => '\\n', "\x0b" => '\\x0b', "\x0c" => '\\x0c', "\x0d" => '\\r', "\x0e" => '\\x0e', "\x0f" => '\\x0f', "\x10" => '\\x10', "\x11" => '\\x11', "\x12" => '\\x12', "\x13" => '\\x13', "\x14" => '\\x14', "\x15" => '\\x15', "\x16" => '\\x16', "\x17" => '\\x17', "\x18" => '\\x18', "\x19" => '\\x19', "\x1a" => '\\x1a', "\x1b" => '\\x1b', "\x1c" => '\\x1c', "\x1d" => '\\x1d', "\x1e" => '\\x1e', "\x1f" => '\\x1f', "\xff" => '\\xff')
Static
 

$_stack

$_stack 

Default

array()

 Constants

 

OP_APPEND

OP_APPEND = 'a' 
 

OP_APPENDS

OP_APPENDS = 'e' 
 

OP_BINBYTES

OP_BINBYTES = 'B' 
 

OP_BINFLOAT

OP_BINFLOAT = 'G' 
 

OP_BINGET

OP_BINGET = 'h' 
 

OP_BININT

OP_BININT = 'J' 
 

OP_BININT1

OP_BININT1 = 'K' 
 

OP_BININT2

OP_BININT2 = 'M' 
 

OP_BINPERSID

OP_BINPERSID = 'Q' 
 

OP_BINPUT

OP_BINPUT = 'q' 
 

OP_BINSTRING

OP_BINSTRING = 'T' 
 

OP_BINUNICODE

OP_BINUNICODE = 'X' 
 

OP_BUILD

OP_BUILD = 'b' 
 

OP_DICT

OP_DICT = 'd' 
 

OP_DUP

OP_DUP = '2' 
 

OP_EMPTY_DICT

OP_EMPTY_DICT = '}' 
 

OP_EMPTY_LIST

OP_EMPTY_LIST = ']' 
 

OP_EMPTY_TUPLE

OP_EMPTY_TUPLE = ')' 
 

OP_EXT1

OP_EXT1 = "\x82" 
 

OP_EXT2

OP_EXT2 = "\x83" 
 

OP_EXT4

OP_EXT4 = "\x84" 
 

OP_FLOAT

OP_FLOAT = 'F' 
 

OP_GET

OP_GET = 'g' 
 

OP_GLOBAL

OP_GLOBAL = 'c' 
 

OP_INST

OP_INST = 'i' 
 

OP_INT

OP_INT = 'I' 
 

OP_LIST

OP_LIST = 'l' 
 

OP_LONG

OP_LONG = 'L' 
 

OP_LONG1

OP_LONG1 = "\x8a" 
 

OP_LONG4

OP_LONG4 = "\x8b" 
 

OP_LONG_BINGET

OP_LONG_BINGET = 'j' 
 

OP_LONG_BINPUT

OP_LONG_BINPUT = 'r' 
 

OP_MARK

OP_MARK = '(' 
 

OP_NEWFALSE

OP_NEWFALSE = "\x89" 
 

OP_NEWOBJ

OP_NEWOBJ = "\x81" 
 

OP_NEWTRUE

OP_NEWTRUE = "\x88" 
 

OP_NONE

OP_NONE = 'N' 
 

OP_OBJ

OP_OBJ = 'o' 
 

OP_PERSID

OP_PERSID = 'P' 
 

OP_POP

OP_POP = '0' 
 

OP_POP_MARK

OP_POP_MARK = '1' 
 

OP_PROTO

OP_PROTO = "\x80" 
 

OP_PUT

OP_PUT = 'p' 
 

OP_REDUCE

OP_REDUCE = 'R' 
 

OP_SETITEM

OP_SETITEM = 's' 
 

OP_SETITEMS

OP_SETITEMS = 'u' 
 

OP_SHORT_BINBYTES

OP_SHORT_BINBYTES = 'C' 
 

OP_SHORT_BINSTRING

OP_SHORT_BINSTRING = 'U' 
 

OP_STOP

OP_STOP = '.' 
 

OP_STRING

OP_STRING = 'S' 
 

OP_TUPLE

OP_TUPLE = 't' 
 

OP_TUPLE1

OP_TUPLE1 = "\x85" 
 

OP_TUPLE2

OP_TUPLE2 = "\x86" 
 

OP_TUPLE3

OP_TUPLE3 = "\x87" 
 

OP_UNICODE

OP_UNICODE = 'V'