z0s / cache
Redis Cache
1.0.2
2022-02-16 15:20 UTC
Requires
- php: >=8.0
- ext-igbinary: *
- ext-redis: *
- illuminate/collections: ^9.1
- predis/predis: ^1.1
Requires (Dev)
- roave/security-advisories: dev-latest
This package is not auto-updated.
Last update: 2024-11-22 02:08:36 UTC
README
Installation
You can include it in your project using: composer require z0s/cache
Requirements
- PHP8.0 or higher
- Redis
- ext-redis
- ext-igbinary
Usage
$connection = new \z0s\Cache\Connection([
'host' => [
'tcp://127.0.0.1'
],
'options' => [
//'replication' => 'sentinel',
//'service' => 'z0s',
//'autodiscovery' => true,
//'cluster' => 'predis',
'parameters' => [
// 'password' => ''
]
]
);
$cache = new \z0s\Cache\Cache($connection);
// Add data
$cache->set('key', 'value', 3600);
// Get data
$cache->get('key');
// Delete
$cache->delete('key');