Download the PHP package horde/pack without Composer

On this page you can find all versions of the php package horde/pack. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pack

horde/Pack

Data packing library that picks the fastest serialization format your PHP installation supports for each value, then optionally compresses the result.

A drop-in replacement for serialize()/json_encode() for cache, session and inter-process payloads. Pack autodetects whether the input contains real PHP objects and chooses a driver that can round- trip it. Compression is on by default for payloads above a configurable size threshold.

Installation

Optional extensions, in priority order (Pack works without any of them but smaller and faster ones come from native code):

Two implementations side by side

The 2.x line ships two parallel implementations in one Composer package:

Both implementations share one wire format: a value packed by either class unpacks under the other. See doc/wire-format.md for the on-disk specification. They cohabit in caches and session blobs without coordination.

The legacy classes are in maintenance mode: bug fixes land if reported, but no new features. New work should target Horde\Pack\Packer.

Quick start (modern API)

Configuring the packer

Constructor parameters are typed and have sensible defaults:

Per-call options

PackOptions is an immutable value object with named constructors and with*() builders:

Factory / builder Effect
PackOptions::compressed($threshold = 128) Compress payloads larger than threshold (the default).
PackOptions::uncompressed() Never compress.
PackOptions::alwaysCompress() Compress every payload regardless of size.
withAllowedDrivers(string ...$classes) Restrict to listed driver classes.
withAllowedClasses(string ...$classes) Restrict object deserialization to listed classes. Empty list disables object deserialization entirely.
withPhpObjects(bool) Skip the autodetect scan and assert whether input contains real PHP objects.

Security: allowedClasses

Driver\Serialize::unpack() honours an allowed_classes whitelist when deserializing PHP objects. Tightening this whitelist closes a deserialization-gadget primitive that an attacker who can corrupt the cache otherwise has access to.

The library default is null (unrestricted) for backwards compatibility with the legacy Horde_Pack. Application factories that wrap Packer are the right layer to apply default-deny:

The other shipped drivers (Json, Igbinary, Msgpack, MsgpackSerialize) do not honour allowedClasses. Json refuses to encode non-stdClass objects in the first place, so the whitelist is moot there. The msgpack and igbinary extensions provide no class-whitelist hook in their deserializers. The option is accepted for interface compatibility but ignored. Callers who need a hard whitelist must restrict the driver set to Serialize only via withAllowedDrivers().

Custom drivers

Implement Horde\Pack\Driver and register your driver against an unused wire-format slot. The canonical drivers occupy slots 1, 2, 4, 8 and 16. Slot 32 is reserved for third-party drivers in the canonical registry layout.

DefaultDriverRegistry's variadic constructor REPLACES the canonical driver set entirely when called with arguments. Pass the canonical drivers explicitly alongside your own if you want to extend rather than replace.

See also

License

LGPL 2.1. See LICENSE.


All versions of pack with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
horde/compress_fast Version ^2 || dev-FRAMEWORK_6_0
horde/exception Version ^3 || dev-FRAMEWORK_6_0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package horde/pack contains the following files

Loading the files please wait ...