add random things for redis

This commit is contained in:
3x0k1d 2025-05-05 06:44:20 +03:00
parent cfaaccea5e
commit 3c868d4bd7

27
checkers/php-redis.php Normal file
View File

@ -0,0 +1,27 @@
<?php
require 'vendor/autoload.php';
use Predis\Client as PredisClient;
$r = new PredisClient([
'scheme' => 'tcp',
'host' => '90.156.203.247',
'port' => 6379,
'password' => 'Ir3Roovu',
'database' => 15,
]);
$r->hset('user-session:123', 'name', 'John');
$r->hset('user-session:123', 'surname', 'Smith');
$r->hset('user-session:123', 'company', 'Redis');
$r->hset('user-session:123', 'age', 29);
echo var_export($r->hgetall('user-session:123')), PHP_EOL;
echo $r->set('foo', 'bar'), PHP_EOL;
// >>> OK
echo $r->get('foo'), PHP_EOL;
// >>> bar