maatify/redis

Official PHP library for maatify.dev Redis Model handler, known by our team

1.0.3 2024-07-20 04:30 UTC

This package is auto-updated.

Last update: 2024-10-20 05:00:53 UTC


README

Current version Packagist PHP Version Support Monthly Downloads Total Downloads Stars

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);