Serializer/Adapter/PythonPickle.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Serializer
- Subpackage
- Adapter
- Version
- $Id$
\Zend_Serializer_Adapter_PythonPickle
- Parent(s)
- \Zend_Serializer_Adapter_AdapterAbstract
- See
- See
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Link
- http://www.python.org
- Link
- http://pickle-js.googlecode.com
Constants
Properties


bool $_isLittleEndian = null
Whether or not the system is little-endian
null
Details- Type
- bool


array $_options = array('protocol' => 0)
Default options
array('protocol' => 0)
Details- Type
- array


array $_quoteString = 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')
Strings representing quotes
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')
Details- Type
- array
Methods


_checkProtocolNumber(int $number) : int
Check and normalize pickle protocol number
Name | Type | Description |
---|---|---|
$number | int |
Type | Description |
---|---|
int |
Exception | Description |
---|---|
\Zend_Serializer_Exception |


_convertMatchingUnicodeSequence2Utf8(array $match) : string
Convert a unicode sequence to UTF-8
Name | Type | Description |
---|---|---|
$match | array |
Type | Description |
---|---|
string |


_decodeBinLong(string $data) : int | float | string
Decode a binary long sequence
Name | Type | Description |
---|---|---|
$data | string |
Type | Description |
---|---|
int | float | string |


_hex2Utf8( $hex) : string
Convert a hex string to a UTF-8 string
Name | Type | Description |
---|---|---|
$hex |
Type | Description |
---|---|
string |
Exception | Description |
---|---|
\Zend_Serializer_Exception | on unmatched unicode sequence |


_isArrayAssoc(array $value) : boolean
Is an array associative?
Name | Type | Description |
---|---|---|
$value | array |
Type | Description |
---|---|
boolean |


_load(string $op) : void
Load a pickle opcode
Name | Type | Description |
---|---|---|
$op | string |
Exception | Description |
---|---|
\Zend_Serializer_Exception | on invalid opcode |


_loadBinGet() : void
Load a binary GET operation
Exception | Description |
---|---|
\Zend_Serializer_Exception | on missing GET identifier |


_loadBinPut() : void
Load a binary PUT
Exception | Description |
---|---|
\Zend_Serializer_Exception | on missing stack |


_loadGet() : void
Load a GET operation
Exception | Description |
---|---|
\Zend_Serializer_Exception | on missing GET identifier |


_loadLongBinGet() : void
Load a long binary GET operation
Exception | Description |
---|---|
\Zend_Serializer_Exception | on missing GET identifier |


_loadLongBinPut() : void
Load a long binary PUT
Exception | Description |
---|---|
\Zend_Serializer_Exception | on missing stack |


_loadProto() : void
Load a proto value
Exception | Description |
---|---|
\Zend_Serializer_Exception | if Pickle version does not support this feature |


_loadPut() : void
Load a PUT opcode
Exception | Description |
---|---|
\Zend_Serializer_Exception | on missing stack |


_momorize(mixed $value) : void
Add a value to the memo and write the id
Name | Type | Description |
---|---|---|
$value | mixed |


_quoteString(string $str) : string
Quote/Escape a string
Name | Type | Description |
---|---|---|
$str | string |
Type | Description |
---|---|
string | quoted string |


_read(mixed $len) : string
Read a segment of the pickle
Name | Type | Description |
---|---|---|
$len | mixed |
Type | Description |
---|---|
string |
Exception | Description |
---|---|
\Zend_Serializer_Exception | if position matches end of data |


_readline() : string
Read a line of the pickle at once
Type | Description |
---|---|
string |
Exception | Description |
---|---|
\Zend_Serializer_Exception | if no EOL character found |


_searchMomo(mixed $value) : int | false
Search a value in the meno and return the id
Name | Type | Description |
---|---|---|
$value | mixed |
Type | Description |
---|---|
int | false | The id or false |


_unquoteString(string $str) : string
Unquote/Unescape a quoted string
Name | Type | Description |
---|---|---|
$str | string | quoted string |
Type | Description |
---|---|
string | unquoted string |


_write(mixed $value) : void
Write a value
Name | Type | Description |
---|---|---|
$value | mixed |
Exception | Description |
---|---|
\Zend_Serializer_Exception | on invalid or unrecognized value type |


_writeArrayDict(array $value) : void
Write an associative array value as dictionary
Name | Type | Description |
---|---|---|
$value | array |


_writeArrayList(array $value) : void
Write a simple array value as list
Name | Type | Description |
---|---|---|
$value | array |


_writeObject(object $value) : void
Write an object as an dictionary
Name | Type | Description |
---|---|---|
$value | object |


serialize(mixed $value, array $opts = array()) : string
Serialize PHP to PythonPickle format
Name | Type | Description |
---|---|---|
$value | mixed | |
$opts | array |
Type | Description |
---|---|
string |


setOption(string $name, mixed $value) : \Zend_Serializer_Adapter_PythonPickle
Set an option
Name | Type | Description |
---|---|---|
$name | string | |
$value | mixed |
Type | Description |
---|---|
\Zend_Serializer_Adapter_PythonPickle |


unserialize(string $pickle, array $opts = array()) : mixed
Unserialize from Python Pickle format to PHP
Name | Type | Description |
---|---|---|
$pickle | string | |
$opts | array |
Type | Description |
---|---|
mixed |
Exception | Description |
---|---|
\Zend_Serializer_Exception | on invalid Pickle string |