Remove MD_STD_CACHE open_redis_default()

This commit is contained in:
Joshua Ramon Enslin 2023-10-05 16:58:48 +02:00
parent 3ece870f0c
commit 2176e7312b
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -10,26 +10,6 @@ declare(strict_types = 1);
* Provides caching functions.
*/
final class MD_STD_CACHE {
/** @var string */
public static string $redis_host = '127.0.0.1';
/** @var integer */
public static int $redis_port = 6379;
/**
* Opens a connection to redis.
*
* @return Redis
*/
public static function open_redis_default():Redis {
$redis = new Redis();
$redis->connect(self::$redis_host, self::$redis_port, 1, null, 0, 0, ['auth' => [MD_CONF::$redis_pw]]);
return $redis;
}
/**
* Shutdown function for caching contents of output buffer.
*
@ -44,8 +24,6 @@ final class MD_STD_CACHE {
$outputT = trim(MD_STD::minimizeHTMLString(MD_STD::ob_get_clean()));
echo $outputT;
$redis = self::open_redis_default();
$redis->set($redisKey, $outputT);
$redis->expire($redisKey, $expiry);
$redis->close();
@ -68,8 +46,6 @@ final class MD_STD_CACHE {
return '';
}
$redis = self::open_redis_default();
if ($redis->ping() !== false) {
ob_start();