quillphp / storage-redis
Redis storage driver for the Quill PHP framework
dev-main
2026-04-06 10:10 UTC
Requires
- php: ^8.3
- quillphp/quill: ^0.0.2
Requires (Dev)
- phpunit/phpunit: ^11.0
Suggests
- ext-redis: Allows using phpredis extension for better performance
This package is auto-updated.
Last update: 2026-04-06 11:54:50 UTC
README
Redis storage driver for the Quill PHP Framework.
Requirements
- PHP 8.3+
ext-redis
Installation
composer require quillphp/storage-redis
Usage
use Quill\Storage\RedisStorage; $storage = new RedisStorage([ 'host' => '127.0.0.1', 'port' => 6379, 'database' => 0, ]); // Write $storage->set('user:42', $payload); $storage->set('session:abc', $data, ttl: 3600); // Read $value = $storage->get('user:42'); $exists = $storage->has('user:42'); // Delete $storage->delete('user:42'); // Always close when done $storage->close();
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
host |
string |
'127.0.0.1' |
Redis server hostname or IP address. |
port |
int |
6379 |
Redis server port. |
password |
string|null |
null |
Password for Redis AUTH. Leave null if authentication is disabled. |
database |
int |
0 |
Redis database index (0–15). |
prefix |
string|null |
null |
Optional string prepended to every key. Useful for namespacing in shared Redis instances. |
timeout |
float |
0.0 |
Connection timeout in seconds. 0.0 means no timeout. |
persistent_id |
string|null |
null |
Enables a persistent connection when set. The value acts as a connection identifier, allowing it to be reused across requests. |
License
MIT