PHPackages                             tsk/simple-redis-dal - 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. [Database &amp; ORM](/categories/database)
4. /
5. tsk/simple-redis-dal

ActiveLibrary[Database &amp; ORM](/categories/database)

tsk/simple-redis-dal
====================

Simple Redis Abstraction

0.04.1(1y ago)4109↓100%1MITPHP

Since Oct 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/cim-engineering/simple-redis-dal)[ Packagist](https://packagist.org/packages/tsk/simple-redis-dal)[ RSS](/packages/tsk-simple-redis-dal/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (9)Used By (0)

README
======

[](#readme)

Simple Redis Abstraction Layer

---

### Installation with composer

[](#installation-with-composer)

Install library via composer

```
composer require tsk/simple-redis-dal

```

### Initialization

[](#initialization)

Simple initialization

```
$db = new hooli("127.0.0.0", "password");
```

### Check if eveything works

[](#check-if-eveything-works)

Simple check

```
$db->ping();
```

### Handling simple values

[](#handling-simple-values)

Set a value

```
$key = "username";
$db->setvalue($key, "MaryPoppins");
```

Get the value

```
$username = $db->getvalue($key);
```

Delete a value

```
$key = "username";
$db->delete($key);
```

Cache a value

```
$key = "session_id";
$value = "12345";
$time = 20 // Time is in minutes

$db->cachevalue($key, $value, $time);
```

Expire a value

```
$key = "session_id";
$time = 1 // Time in minutes

$db->expire($key, $time);
```

### Dealing with Hashes

[](#dealing-with-hashes)

Create a hash / Store data into a hash (record types structured as collections of field-value pairs)

```
$data = [
    "firstName" => "Mary",
    "lastName" => "Poppins",
    "email" => "marypoppins@email.com",
    "location" => "USA, New York"
];
$HashName = 'marypoppins@email.com';
$db->createhash($HashName, $data);
```

Check if a value exists in a hash

```
$HashName = 'marypoppins@email.com';
$db->checkhash($HashName, "firstName");
```

Update / replace a single value in a hash

```
$HashName = 'marypoppins@email.com';
$db->replacehash($HashName, "location", "Nigeria, Lagos");
```

Insert new value into hash

```
$HashName = 'marypoppins@email.com';
$db->inserthash($HashName, "age", 32);
```

Fetch all values in a single hash

```
$HashName = 'marypoppins@email.com';
$db->gethash($HashName);

or using return types
$db->json()->gethash($HashName);
```

Count the keys in a hash

```
$HashName = 'marypoppins@email.com';
$count = $db->countkeys($HashName);
```

Increase a value in a hash

```
$HashName = 'marypoppins@email.com';
$key = 'age'; // The value of this key must be an integer
$increaseBy = 4;
$db->increase($HashName, $key); // This method increases the value by one
$db->increaseby($HashName, $key, $increaseBy); // This method increases the value by the specified number
```

### Dealing with lists

[](#dealing-with-lists)

Insert value into a list

```
$List = "users";
$db->insertlist($List, "something@email.com");
```

search for a value inside a list

```
$List = "users";
if($db->search_list($List, "something@email.com")){
    echo 'value exists';
}
```

Count number of values /entries in a List

```
$List = "users";
$db->countlist($List);
```

Delete a List

```
$List = "users";
$db->deletelist($List);
```

Return all values in a List as JSON return type

```
$List = "users";
$db->json()->getlist($List);
```

Get a specific number of elements from a list

```
$List = "users";
$num = 10;
$users = $db->getlistnum($List, $num); // Returns an array
```

### Dealing with HashLists

[](#dealing-with-hashlists)

Save hashes to list (HashList) while mapping each value in list to key in hash

```
$data = [
    "firstName" => "Mary",
    "lastName" => "Poppins",
    "email" => "marypoppins@email.com",
    "location" => "USA, New York"
];
$list = "users";
$userID = "mary123";
$db->inserthashlist($userID, $data, $list);
```

Return all data in a HashList as json

```
$list = "users";
echo $db->gethashlist($list);
```

### fetching specified number of keys in a list

[](#fetching-specified-number-of-keys-in-a-list)

list Name of the Redis list num is asigned the number of keys to be fetched

```
echo $db->getlistnum($list, $num)
```

### Fetching specified number of hashes

[](#fetching-specified-number-of-hashes)

list Name of the Redis list num reperesents the number of hashes to fetch from a list

```
echo $db->gethashlistnum($list, $num)
```

Collaborators ✨
---------------

[](#collaborators-)

  [ ![timek](https://avatars.githubusercontent.com/u/2828143?v=4)
 **Tim3k** ](https://github.com/timek)   [ ![kusaasira](https://avatars.githubusercontent.com/u/10392992?v=4)
 **Joshua Kusaasira** ](https://github.com/kusaasira)   [ ![Marshud](https://avatars.githubusercontent.com/u/63245157?v=4)
 **Marshud** ](https://github.com/Marshud)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance40

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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 ~192 days

Total

5

Last Release

539d ago

### Community

Maintainers

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

---

Top Contributors

[![cimengineering](https://avatars.githubusercontent.com/u/85415244?v=4)](https://github.com/cimengineering "cimengineering (19 commits)")[![timek](https://avatars.githubusercontent.com/u/2828143?v=4)](https://github.com/timek "timek (18 commits)")[![Marshud](https://avatars.githubusercontent.com/u/63245157?v=4)](https://github.com/Marshud "Marshud (11 commits)")[![pheellzz](https://avatars.githubusercontent.com/u/27870213?v=4)](https://github.com/pheellzz "pheellzz (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tsk-simple-redis-dal/health.svg)

```
[![Health](https://phpackages.com/badges/tsk-simple-redis-dal/health.svg)](https://phpackages.com/packages/tsk-simple-redis-dal)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M540](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M208](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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