Horde_Serialize
in package
The Serialize:: class provides various methods of encapsulating data.
Copyright 2001-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Tags
Table of Contents
- BASE64 = 10
- BASIC = 6
- BZIP = 2
- GZ_COMPRESS = 8
- GZ_DEFLATE = 7
- GZ_ENCODE = 9
- IMAP8 = 3
- IMAPUTF7 = 4
- IMAPUTF8 = 5
- JSON = 16
- LZF = 17
- NONE = 0
- RAW = 12
- UNKNOWN = -1
- URL = 13
- UTF7 = 14
- UTF7_BASIC = 15
- WDDX = 1
- hasCapability() : bool
- Check whether or not a serialization method is supported.
- serialize() : string
- Serialize a value.
- unserialize() : string
- Unserialize a value.
- _serialize() : string
- Serialize data.
- _unserialize() : mixed
- Unserialize data.
Constants
BASE64
public
mixed
BASE64
= 10
BASIC
public
mixed
BASIC
= 6
BZIP
public
mixed
BZIP
= 2
GZ_COMPRESS
public
mixed
GZ_COMPRESS
= 8
GZ_DEFLATE
public
mixed
GZ_DEFLATE
= 7
GZ_ENCODE
public
mixed
GZ_ENCODE
= 9
IMAP8
public
mixed
IMAP8
= 3
IMAPUTF7
public
mixed
IMAPUTF7
= 4
IMAPUTF8
public
mixed
IMAPUTF8
= 5
JSON
public
mixed
JSON
= 16
LZF
public
mixed
LZF
= 17
NONE
public
mixed
NONE
= 0
RAW
public
mixed
RAW
= 12
UNKNOWN
public
mixed
UNKNOWN
= -1
URL
public
mixed
URL
= 13
UTF7
public
mixed
UTF7
= 14
UTF7_BASIC
public
mixed
UTF7_BASIC
= 15
WDDX
public
mixed
WDDX
= 1
Methods
hasCapability()
Check whether or not a serialization method is supported.
public
static hasCapability(int $mode) : bool
Parameters
- $mode : int
-
The serialization method.
Return values
bool —True if supported, false if not.
serialize()
Serialize a value.
public
static serialize(mixed $data[, mixed $mode = array(self::BASIC) ][, mixed $params = null ]) : string
See the list of constants at the top of the file for the serializing techniques that can be used.
Parameters
- $data : mixed
-
The data to be serialized.
- $mode : mixed = array(self::BASIC)
-
The mode of serialization. Can be either a single mode or array of modes. If array, will be serialized in the order provided.
- $params : mixed = null
-
Any additional parameters the serialization method requires.
Tags
Return values
string —The serialized data.
unserialize()
Unserialize a value.
public
static unserialize(mixed $data[, mixed $mode = self::BASIC ][, mixed $params = null ]) : string
See the list of constants at the top of the file for the serializing techniques that can be used.
Parameters
- $data : mixed
-
The data to be unserialized.
- $mode : mixed = self::BASIC
-
The mode of unserialization. Can be either a single mode or array of modes. If array, will be unserialized in the order provided.
- $params : mixed = null
-
Any additional parameters the unserialization method requires.
Tags
Return values
string —The unserialized data.
_serialize()
Serialize data.
protected
static _serialize(mixed $data, mixed $mode[, mixed $params = null ]) : string
Parameters
- $data : mixed
-
The data to be serialized.
- $mode : mixed
-
The mode of serialization. Can be either a single mode or array of modes. If array, will be serialized in the order provided.
- $params : mixed = null
-
Any additional parameters the serialization method requires.
Tags
Return values
string —A serialized string.
_unserialize()
Unserialize data.
protected
static _unserialize(mixed &$data, mixed $mode[, mixed $params = null ]) : mixed
Parameters
- $data : mixed
-
The data to be unserialized.
- $mode : mixed
-
The mode of unserialization. Can be either a single mode or array of modes. If array, will be unserialized in the order provided.
- $params : mixed = null
-
Any additional parameters the unserialization method requires.
Tags
Return values
mixed —Unserialized data.