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 = nullWhether or not the system is little-endian
nullDetails- 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) : intCheck and normalize pickle protocol number
| Name | Type | Description |
|---|---|---|
| $number | int |
| Type | Description |
|---|---|
| int |
| Exception | Description |
|---|---|
| \Zend_Serializer_Exception |

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

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

_hex2Utf8( $hex) : stringConvert 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) : booleanIs an array associative?
| Name | Type | Description |
|---|---|---|
| $value | array |
| Type | Description |
|---|---|
| boolean |

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

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

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

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

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

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

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

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

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

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

_read(mixed $len) : stringRead 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() : stringRead a line of the pickle at once
| Type | Description |
|---|---|
| string |
| Exception | Description |
|---|---|
| \Zend_Serializer_Exception | if no EOL character found |

_searchMomo(mixed $value) : int | falseSearch 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) : stringUnquote/Unescape a quoted string
| Name | Type | Description |
|---|---|---|
| $str | string | quoted string |
| Type | Description |
|---|---|
| string | unquoted string |

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

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

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

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

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

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

unserialize(string $pickle, array $opts = array()) : mixedUnserialize 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 |