\Horde_Serialize

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.

Summary

Methods
Properties
Constants
serialize()
unserialize()
hasCapability()
No public properties found
UNKNOWN
NONE
WDDX
BZIP
IMAP8
IMAPUTF7
IMAPUTF8
BASIC
GZ_DEFLATE
GZ_COMPRESS
GZ_ENCODE
BASE64
RAW
URL
UTF7
UTF7_BASIC
JSON
LZF
_serialize()
_unserialize()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

UNKNOWN

UNKNOWN

NONE

NONE

WDDX

WDDX

BZIP

BZIP

IMAP8

IMAP8

IMAPUTF7

IMAPUTF7

IMAPUTF8

IMAPUTF8

BASIC

BASIC

GZ_DEFLATE

GZ_DEFLATE

GZ_COMPRESS

GZ_COMPRESS

GZ_ENCODE

GZ_ENCODE

BASE64

BASE64

RAW

RAW

URL

URL

UTF7

UTF7

UTF7_BASIC

UTF7_BASIC

JSON

JSON

LZF

LZF

Methods

serialize()

serialize(mixed  $data, mixed  $mode = array(self::BASIC), mixed  $params = null) : string

Serialize a value.

See the list of constants at the top of the file for the serializing techniques that can be used.

Parameters

mixed $data

The data to be serialized.

mixed $mode

The mode of serialization. Can be either a single mode or array of modes. If array, will be serialized in the order provided.

mixed $params

Any additional parameters the serialization method requires.

Throws

\Horde_Serialize_Exception

Returns

string —

The serialized data.

unserialize()

unserialize(mixed  $data, mixed  $mode = self::BASIC, mixed  $params = null) : string

Unserialize a value.

See the list of constants at the top of the file for the serializing techniques that can be used.

Parameters

mixed $data

The data to be unserialized.

mixed $mode

The mode of unserialization. Can be either a single mode or array of modes. If array, will be unserialized in the order provided.

mixed $params

Any additional parameters the unserialization method requires.

Throws

\Horde_Serialize_Exception

Returns

string —

The unserialized data.

hasCapability()

hasCapability(integer  $mode) : boolean

Check whether or not a serialization method is supported.

Parameters

integer $mode

The serialization method.

Returns

boolean —

True if supported, false if not.

_serialize()

_serialize(mixed  $data, mixed  $mode, mixed  $params = null) : string

Serialize data.

Parameters

mixed $data

The data to be serialized.

mixed $mode

The mode of serialization. Can be either a single mode or array of modes. If array, will be serialized in the order provided.

mixed $params

Any additional parameters the serialization method requires.

Throws

\Horde_Serialize_Exception

Returns

string —

A serialized string.

_unserialize()

_unserialize(mixed  $data, mixed  $mode, mixed  $params = null) : mixed

Unserialize data.

Parameters

mixed $data

The data to be unserialized.

mixed $mode

The mode of unserialization. Can be either a single mode or array of modes. If array, will be unserialized in the order provided.

mixed $params

Any additional parameters the unserialization method requires.

Throws

\Horde_Serialize_Exception

Returns

mixed —

Unserialized data.