Update -> refactor and optimize UI , code ,...

This commit is contained in:
2026-04-10 11:35:25 +03:30
parent 3327207f05
commit 0de951fd91
20 changed files with 1085 additions and 282 deletions

View File

@@ -1,13 +1,14 @@
<?php
function redisClient()
function redisClient(): Redis
{
static $redis = null;
if ($redis === null) {
$config = require __DIR__ . '/../config/config.php';
$redis = new Redis();
$redis->connect($config['redis']['host'], $config['redis']['port']);
$redis = new Redis();
if (!@$redis->connect($config['redis']['host'], $config['redis']['port'])) {
throw new RuntimeException('Redis connection failed.');
}
}
return $redis;
}