PHP Class Horde_Pack, horde

Author: Michael Slusarz ([email protected])
Show file Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_compress Horde_Compress_Fast Instance of Horde_Compress_Fast shared between all instances.
$_drivers array Drivers. Shared between all instances.

Public Methods

Method Description
__construct ( ) Constructor.
__sleep ( )
pack ( mixed $data, array $opts = [] ) : string Pack a string.
unpack ( string $data ) : mixed Unpack a string.

Method Details

__construct() public method

Constructor.
public __construct ( )

__sleep() public method

public __sleep ( )

pack() public method

Pack a string.
public pack ( mixed $data, array $opts = [] ) : string
$data mixed The data to pack.
$opts array Additional options:
  - compress: (mixed) If false, don't use compression. If true, uses
              default compress length (DEFAULT). If 0, always compress.
              All other integer values: compress only if data is
              greater than this string length.
  - drivers: (array) Only use these drivers to pack. By default, driver
             to use is auto-determined.
  - phpob: (boolean) If true, the data contains PHP serializable
           objects (i.e. objects that have a PHP-specific serialized
           representation). If false, the data does not contain any of
           these objects. If not present, will auto-determine
           existence of these objects.
return string The packed string.

unpack() public method

Unpack a string.
public unpack ( string $data ) : mixed
$data string The packed string.
return mixed The unpacked data.

Property Details

$_compress protected static property

Instance of Horde_Compress_Fast shared between all instances.
protected static Horde_Compress_Fast $_compress
return Horde_Compress_Fast

$_drivers protected static property

Drivers. Shared between all instances.
protected static array $_drivers
return array