Zend\Serializer\Adapter\PythonPickle
Synopsis
class PythonPickle
extends AbstractAdapter
{
- // constants
- const OP_MARK = '(';
- const OP_STOP = '.';
- const OP_POP = '0';
- const OP_POP_MARK = '1';
- const OP_DUP = '2';
- const OP_FLOAT = 'F';
- const OP_INT = 'I';
- const OP_BININT = 'J';
- const OP_BININT1 = 'K';
- const OP_LONG = 'L';
- const OP_BININT2 = 'M';
- const OP_NONE = 'N';
- const OP_PERSID = 'P';
- const OP_BINPERSID = 'Q';
- const OP_REDUCE = 'R';
- const OP_STRING = 'S';
- const OP_BINSTRING = 'T';
- const OP_SHORT_BINSTRING = 'U';
- const OP_UNICODE = 'V';
- const OP_BINUNICODE = 'X';
- const OP_APPEND = 'a';
- const OP_BUILD = 'b';
- const OP_GLOBAL = 'c';
- const OP_DICT = 'd';
- const OP_EMPTY_DICT = '}';
- const OP_APPENDS = 'e';
- const OP_GET = 'g';
- const OP_BINGET = 'h';
- const OP_INST = 'i';
- const OP_LONG_BINGET = 'j';
- const OP_LIST = 'l';
- const OP_EMPTY_LIST = ']';
- const OP_OBJ = 'o';
- const OP_PUT = 'p';
- const OP_BINPUT = 'q';
- const OP_LONG_BINPUT = 'r';
- const OP_SETITEM = 's';
- const OP_TUPLE = 't';
- const OP_EMPTY_TUPLE = ')';
- const OP_SETITEMS = 'u';
- const OP_BINFLOAT = 'G';
- const OP_PROTO = "\x80";
- const OP_NEWOBJ = "\x81";
- const OP_EXT1 = "\x82";
- const OP_EXT2 = "\x83";
- const OP_EXT4 = "\x84";
- const OP_TUPLE1 = "\x85";
- const OP_TUPLE2 = "\x86";
- const OP_TUPLE3 = "\x87";
- const OP_NEWTRUE = "\x88";
- const OP_NEWFALSE = "\x89";
- const OP_LONG1 = "\x8a";
- const OP_LONG4 = "\x8b";
- const OP_BINBYTES = 'B';
- const OP_SHORT_BINBYTES = 'C';
- // members
- protected bool $isLittleEndian;
- protected array $quoteString;
- protected $protocol;
- protected array $memo;
- protected string $pickle;
- protected integer $pickleLen;
- protected integer $pos;
- protected array $stack;
- protected $marker;
- protected AdapterInterface $bigIntegerAdapter;
- protected PythonPickleOptions $options;
- // Inherited members from AbstractAdapter
- protected AdapterOptions $options;
- // methods
- public void __construct()
- public PythonPickle setOptions()
- public PythonPickleOptions getOptions()
- public string serialize()
- protected void write()
- protected void writeProto()
- protected void writeGet()
- protected void writePut()
- protected void writeNull()
- protected void writeBool()
- protected void writeInt()
- protected void writeFloat()
- protected void writeString()
- protected void writeArrayDict()
- protected void writeArrayList()
- protected void writeObject()
- protected void writeStop()
- protected void memorize()
- protected int|bool searchMemo()
- protected string quoteString()
- public mixed unserialize()
- protected void clearProcessVars()
- protected void load()
- protected void loadPut()
- protected void loadBinPut()
- protected void loadLongBinPut()
- protected void loadGet()
- protected void loadBinGet()
- protected void loadLongBinGet()
- protected void loadNone()
- protected void loadNewTrue()
- protected void loadNewFalse()
- protected void loadInt()
- protected void loadBinInt()
- protected void loadBinInt1()
- protected void loadBinInt2()
- protected void loadLong()
- protected void loadLong1()
- protected void loadLong4()
- protected void loadFloat()
- protected void loadBinFloat()
- protected void loadString()
- protected void loadBinString()
- protected void loadShortBinString()
- protected void loadBinBytes()
- protected void loadShortBinBytes()
- protected void loadUnicode()
- protected string _convertMatchingUnicodeSequence2Utf8()
- protected string hex2Utf8()
- protected void loadBinUnicode()
- protected void loadMark()
- protected void loadList()
- protected void loadAppend()
- protected void loadEmptyList()
- protected void loadAppends()
- protected void loadDict()
- protected void loadSetItem()
- protected void _loadEmptyDict()
- protected void loadSetItems()
- protected void loadTuple()
- protected void loadTuple1()
- protected void loadTuple2()
- protected void loadTuple3()
- protected void loadProto()
- protected string read()
- protected string readline()
- protected string unquoteString()
- protected int lastMarker()
- protected int|float|string decodeBinLong()
- // Inherited methods from AbstractAdapter
- public void __construct()
- public AbstractAdapter setOptions()
- public AdapterOptions getOptions()
Hierarchy
Constants
Name | Value |
---|---|
OP_MARK | '(' |
OP_STOP | '.' |
OP_POP | '0' |
OP_POP_MARK | '1' |
OP_DUP | '2' |
OP_FLOAT | 'F' |
OP_INT | 'I' |
OP_BININT | 'J' |
OP_BININT1 | 'K' |
OP_LONG | 'L' |
OP_BININT2 | 'M' |
OP_NONE | 'N' |
OP_PERSID | 'P' |
OP_BINPERSID | 'Q' |
OP_REDUCE | 'R' |
OP_STRING | 'S' |
OP_BINSTRING | 'T' |
OP_SHORT_BINSTRING | 'U' |
OP_UNICODE | 'V' |
OP_BINUNICODE | 'X' |
OP_APPEND | 'a' |
OP_BUILD | 'b' |
OP_GLOBAL | 'c' |
OP_DICT | 'd' |
OP_EMPTY_DICT | '}' |
OP_APPENDS | 'e' |
OP_GET | 'g' |
OP_BINGET | 'h' |
OP_INST | 'i' |
OP_LONG_BINGET | 'j' |
OP_LIST | 'l' |
OP_EMPTY_LIST | ']' |
OP_OBJ | 'o' |
OP_PUT | 'p' |
OP_BINPUT | 'q' |
OP_LONG_BINPUT | 'r' |
OP_SETITEM | 's' |
OP_TUPLE | 't' |
OP_EMPTY_TUPLE | ')' |
OP_SETITEMS | 'u' |
OP_BINFLOAT | 'G' |
OP_PROTO | "\x80" |
OP_NEWOBJ | "\x81" |
OP_EXT1 | "\x82" |
OP_EXT2 | "\x83" |
OP_EXT4 | "\x84" |
OP_TUPLE1 | "\x85" |
OP_TUPLE2 | "\x86" |
OP_TUPLE3 | "\x87" |
OP_NEWTRUE | "\x88" |
OP_NEWFALSE | "\x89" |
OP_LONG1 | "\x8a" |
OP_LONG4 | "\x8b" |
OP_BINBYTES | 'B' |
OP_SHORT_BINBYTES | 'C' |
Members
protected
- $bigIntegerAdapter — Zend\Serializer\Adapter\BigInteger\Adapter\AdapterInterface
- $isLittleEndian
—
Zend\Serializer\Adapter\bool
Whether or not the system is little-endian - $marker
- $memo
- $options — Zend\Serializer\Adapter\PythonPickleOptions
- $options — Zend\Serializer\Adapter\AdapterOptions
- $pickle
- $pickleLen
- $pos
- $protocol
- $quoteString — array
- $stack
Methods
protected
- _convertMatchingUnicodeSequence2Utf8() — Convert a unicode sequence to UTF-8
- _loadEmptyDict() — Load an empty dictionary
- clearProcessVars() — Clear temp variables needed for processing
- decodeBinLong() — Decode a binary long sequence
- hex2Utf8() — Convert a hex string to a UTF-8 string
- lastMarker() — Return last marker position in stack
- load() — Load a pickle opcode
- loadAppend() — Load an append (to list) sequence
- loadAppends() — Load multiple append (to list) sequences at once
- loadBinBytes() — Load arbitrary binary bytes
- loadBinFloat() — Load a binary float value
- loadBinGet() — Load a binary GET operation
- loadBinInt() — Load a binary integer operator
- loadBinInt1() — Load the first byte of a binary integer
- loadBinInt2() — Load the second byte of a binary integer
- loadBinPut() — Load a binary PUT
- loadBinString() — Load a binary string
- loadBinUnicode() — Load binary unicode sequence
- loadDict() — Load an associative array (Python dictionary)
- loadEmptyList() — Load an empty list sequence
- loadFloat() — Load a float value
- loadGet() — Load a GET operation
- loadInt() — Load an integer operator
- loadList() — Load an array (list)
- loadLong() — Load a long (float) operator
- loadLong1() — Load a one byte long integer
- loadLong4() — Load a 4 byte long integer
- loadLongBinGet() — Load a long binary GET operation
- loadLongBinPut() — Load a long binary PUT
- loadMark() — Load a marker sequence
- loadNewFalse() — Load a boolean FALSE operator
- loadNewTrue() — Load a boolean TRUE operator
- loadNone() — Load a NONE operator
- loadProto() — Load a proto value
- loadPut() — Load a PUT opcode
- loadSetItem() — Load an item from a set
- loadSetItems() — Load set items
- loadShortBinBytes() — Load a single binary byte
- loadShortBinString() — Load a short binary string
- loadString() — Load a string
- loadTuple() — Load a tuple
- loadTuple1() — Load single item tuple
- loadTuple2() — Load two item tuple
- loadTuple3() — Load three item tuple
- loadUnicode() — Load a unicode string
- memorize() — Add a value to the memo and write the id
- quoteString() — Quote/Escape a string
- read() — Read a segment of the pickle
- readline() — Read a line of the pickle at once
- searchMemo() — Search a value in the memo and return the id
- unquoteString() — Unquote/Unescape a quoted string
- write() — Write a value
- writeArrayDict() — Write an associative array value as dictionary
- writeArrayList() — Write a simple array value as list
- writeBool() — Write boolean value
- writeFloat() — Write a float value
- writeGet() — Write a get
- writeInt() — Write an integer value
- writeNull() — Write a null as None
- writeObject() — Write an object as a dictionary
- writeProto() — Write pickle protocol
- writePut() — Write a put
- writeStop() — Write stop
- writeString() — Write a string value
public
- __construct() — Constructor.
- getOptions() — Get options
- serialize() — Serialize PHP to PythonPickle format
- setOptions() — Set options
- unserialize() — Unserialize from Python Pickle format to PHP
Inherited from Zend\Serializer\Adapter\AbstractAdapter
public
- getOptions() — Get adapter options
- setOptions() — Set adapter options