Serializer/Adapter/PythonPickle.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- 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
Package: Zend_Serializer\Adapter- 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



$_binary = falseDefault valuefalseDetails- Type
- n/a



bool $_isLittleEndian = nullstaticWhether or not the system is little-endian
Default valuenullDetails- Type
- bool



bool $_isPhp6 = nullstaticWhether or not this is a PHP 6 binary
Default valuenullDetails- Type
- bool



$_marker = nullDefault valuenullDetails- Type
- n/a



$_memo = array()Default valuearray()Details- Type
- n/a



$_pickle = ''Default value''Details- Type
- n/a



$_pickleLen = 0Default value0Details- Type
- n/a



$_pos = 0Default value0Details- Type
- n/a



$_protocol = 0Default value0Details- Type
- n/a



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')staticStrings representing quotes
Default valuearray('\\' => '\\\\', "\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



$_stack = array()Default valuearray()Details- Type
- n/a
Methods



_checkProtocolNumber(int $number) : intCheck and normalize pickle protocol number
Parameters| Name | Type | Description |
|---|
| $number | int | |
|---|
ReturnsThrows 


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


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



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



_read(mixed $len) : stringRead a segment of the pickle
Parameters| Name | Type | Description |
|---|
| $len | mixed | |
|---|
ReturnsThrows 


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



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



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



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



_writeGet(int $id) : voidParameters| Name | Type | Description |
|---|
| $id | int | Id of memo |
|---|



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



_writePut(int $id) : voidParameters| Name | Type | Description |
|---|
| $id | int | Id of memo |
|---|



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


unserialize(string $pickle, array $opts = array()) : mixedUnserialize from Python Pickle format to PHP
Parameters| Name | Type | Description |
|---|
| $pickle | string | |
|---|
| $opts | array | |
|---|
ReturnsThrows