maatify / redis
Official PHP library for maatify.dev Redis Model handler, known by our team
1.0.3
2024-07-20 04:30 UTC
Requires
- php: >=8.0
- ext-pdo: *
- ext-redis: *
- maatify/functions: ^1.2
- maatify/json: ^1.0
- maatify/logger: ^1.0
- maatify/post-validator-v2: ^1.1
README
Redis
maatify.dev Redis handler, known by our team
Installation
composer require maatify/rides
Usage
Create Default Connection
<?php $redis = new RedisDefaultHandler('maatify:'); $key_name = 'test'; $redis->Set($key_name, 'test:' . date('Y-m-d H:i:s')); echo $redis->Get($key_name); echo '<br><hr><br>'; echo $redis->TTL($key_name);
Create specified Connection
<?php $redis = new RedisHandler( (string) $redis_host = '127.0.0.1', (int) $redis_port = 6379, (string) $redis_password = 'Your Redis Password', (int) $redis_database = 1, (int) $redis_expiry = 5*60, (string) $redis_website_prefix = 'maatify:' ); $key_name = 'test_maatify'; $redis->Set($key_name, 'test_maatify:' . date('Y-m-d H:i:s')); echo $redis->Get($key_name); echo '<br><hr><br>'; echo $redis->TTL($key_name);