PHPackages                             horde/hashtable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. horde/hashtable

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

horde/hashtable
===============

Hash table client library

v2.0.0(2w ago)14.3k↑37.1%4[1 issues](https://github.com/horde/HashTable/issues)4LGPL-2.1-onlyPHPPHP ^8.1

Since Feb 11Pushed 2d ago5 watchersCompare

[ Source](https://github.com/horde/HashTable)[ Packagist](https://packagist.org/packages/horde/hashtable)[ Docs](https://www.horde.org)[ RSS](/packages/horde-hashtable/feed)WikiDiscussions FRAMEWORK\_6\_0 Synced 2d ago

READMEChangelog (7)Dependencies (17)Versions (29)Used By (4)

Horde HashTable
===============

[](#horde-hashtable)

Key/Value store abstraction with driver-specific capabilities for Redis native data structures, cross-process locking and transparent serialization of mixed PHP values.

Interfaces
----------

[](#interfaces)

InterfaceCapability`HashTable`get/set/delete/exists with mixed values and optional TTL`LockableHashTable`Cross-process lock/unlock (Redis, Memcache)`RedisHashTable`Atomic counters, hashes, lists, sets, TTL introspectionDrivers
-------

[](#drivers)

DriverImplementsBackend`Driver\Redis``RedisHashTable`ext-redis (preferred) or Predis ^3`Driver\Memcache``LockableHashTable``Horde\Memcache\MemcacheApi``Driver\Memory``HashTable`In-process array (testing/development)`Driver\NullDriver``HashTable`No-op (always misses)Installation
------------

[](#installation)

```
composer require horde/hashtable
```

For Redis (recommended):

```
# Preferred: C extension
pecl install redis

# Fallback: pure PHP
composer require predis/predis:^3
```

Usage
-----

[](#usage)

```
use Horde\HashTable\Driver\Redis;
use Redis as PhpRedis;

$client = new PhpRedis();
$client->connect('127.0.0.1', 6379);

$ht = new Redis(client: $client, prefix: 'myapp_');

// Basic key-value
$ht->set('user:1', ['name' => 'Alice'], ttl: 3600);
$data = $ht->get('user:1');  // returns array or null

// Locking
$ht->lock('user:1');
try {
    $ht->set('user:1', ['name' => 'Bob']);
} finally {
    $ht->unlock('user:1');
}

// Redis-native structures
$ht->increment('counter');
$ht->listPush('queue', $job);
$ht->hashSet('session:abc', 'last_access', time());
$ht->setAdd('tags:post:1', 'php', 'redis');
```

Horde Core Integration
----------------------

[](#horde-core-integration)

When used inside a Horde application, you can obtain instances via dependency injection:

```
use Horde\HashTable\HashTable;
use Horde\HashTable\LockableHashTable;
use Horde\HashTable\RedisHashTable;

// Any configured driver
$ht = $injector->get(HashTable::class);

// Only drivers with real cross-process locking
$ht = $injector->get(LockableHashTable::class);

// Full Redis power (counters, hashes, lists, sets)
$ht = $injector->get(RedisHashTable::class);
```

Configuration is read from `conf.php` under the `hashtable` key by `Horde\Core\Factory\HashTableFactory`.

Legacy API
----------

[](#legacy-api)

The PSR-0 classes under `lib/` (`Horde_HashTable_Base`, `Horde_HashTable_Predis`, etc.) remain available for backward compatibility. New code should use the PSR-4 interfaces in `src/`. See [doc/UPGRADING.md](doc/UPGRADING.md) for migration details.

License
-------

[](#license)

LGPL-2.1-only — see [LICENSE](LICENSE).

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance78

Regular maintenance activity

Popularity27

Limited adoption so far

Community30

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~215 days

Recently: every ~11 days

Total

22

Last Release

19d ago

Major Versions

1.2.6 → 2.0.0alpha12021-02-24

PHP version history (6 changes)1.1.1PHP &gt;=5.3.0

1.1.3PHP &gt;=5.3.0,&lt;=6.0.0alpha1

1.2.4PHP &gt;=5.3.0,&lt;=8.0.0alpha1

2.0.0alpha1PHP ^7

v2.0.0alpha4PHP ^7.4 || ^8

v2.0.0beta3PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c943a083635c28520599075eaea7ede2d743b7697b76e84d6bdc37e52cc8249b?d=identicon)[yunosh](/maintainers/yunosh)

![](https://www.gravatar.com/avatar/c931cd02664859360478593450d6c473a05bb12b209dfacfc534cd13257cc7ef?d=identicon)[ralflang](/maintainers/ralflang)

![](https://www.gravatar.com/avatar/e4f6c6771993db2ed500959b42353f6cf6a2ca0406d9617f7ae680f4504faa4a?d=identicon)[horde](/maintainers/horde)

![](https://www.gravatar.com/avatar/a7767adb66b45f2f05bcd44d49bc4e67efacd9ce05b161ce2d481d5dd6af025c?d=identicon)[mrubinsk](/maintainers/mrubinsk)

![](https://www.gravatar.com/avatar/816e2b926f25f8cd2939054c7a7173011b4303d690e25ab61bf33cf8c7cf71ae?d=identicon)[tdannhauer](/maintainers/tdannhauer)

---

Top Contributors

[![yunosh](https://avatars.githubusercontent.com/u/379318?v=4)](https://github.com/yunosh "yunosh (80 commits)")[![slusarz](https://avatars.githubusercontent.com/u/381003?v=4)](https://github.com/slusarz "slusarz (41 commits)")[![ralflang](https://avatars.githubusercontent.com/u/646976?v=4)](https://github.com/ralflang "ralflang (39 commits)")[![mrubinsk](https://avatars.githubusercontent.com/u/66822?v=4)](https://github.com/mrubinsk "mrubinsk (3 commits)")[![joaomachado](https://avatars.githubusercontent.com/u/143567?v=4)](https://github.com/joaomachado "joaomachado (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/horde-hashtable/health.svg)

```
[![Health](https://phpackages.com/badges/horde-hashtable/health.svg)](https://phpackages.com/packages/horde-hashtable)
```

###  Alternatives

[horde/horde

Horde base application

583.0k71](/packages/horde-horde)[horde/kronolith

Calendar and scheduling application

101.5k5](/packages/horde-kronolith)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
