Documentation

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
author

Stephane Huther shuther1@free.fr

author

Michael Slusarz slusarz@horde.org

category

Horde

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

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
throws
Horde_Serialize_Exception
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
throws
Horde_Serialize_Exception
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
throws
Horde_Serialize_Exception
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
throws
Horde_Serialize_Exception
Return values
mixed

Unserialized data.

Search results