Remove MD_STD_CACHE open_redis_default()
This commit is contained in:
parent
3ece870f0c
commit
2176e7312b
@ -10,26 +10,6 @@ declare(strict_types = 1);
|
|||||||
* Provides caching functions.
|
* Provides caching functions.
|
||||||
*/
|
*/
|
||||||
final class MD_STD_CACHE {
|
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.
|
* 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()));
|
$outputT = trim(MD_STD::minimizeHTMLString(MD_STD::ob_get_clean()));
|
||||||
echo $outputT;
|
echo $outputT;
|
||||||
|
|
||||||
$redis = self::open_redis_default();
|
|
||||||
|
|
||||||
$redis->set($redisKey, $outputT);
|
$redis->set($redisKey, $outputT);
|
||||||
$redis->expire($redisKey, $expiry);
|
$redis->expire($redisKey, $expiry);
|
||||||
$redis->close();
|
$redis->close();
|
||||||
@ -68,8 +46,6 @@ final class MD_STD_CACHE {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$redis = self::open_redis_default();
|
|
||||||
|
|
||||||
if ($redis->ping() !== false) {
|
if ($redis->ping() !== false) {
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user