From 0bf9cfdc75253df9fd427d870b535d0628c4d20c Mon Sep 17 00:00:00 2001 From: rsgrinko Date: Fri, 10 Dec 2021 17:48:33 +0300 Subject: [PATCH] =?UTF-8?q?[+]=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BC=D0=B5=D0=BC=D0=BA=D1=8D=D1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/lib/CCache.class.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/inc/lib/CCache.class.php b/inc/lib/CCache.class.php index 5434827..7f366c4 100644 --- a/inc/lib/CCache.class.php +++ b/inc/lib/CCache.class.php @@ -192,6 +192,36 @@ class CCache { return (time() - @filectime(self::$cache_dir . md5($name) . '.tmp')); } + + + /** + * Тестовый метод для записи в мемкэш + * TODO: переделать + */ + public static function memcacheWrite($name, $value):bool { + $memcache = memcache_connect('localhost', 11211); + + if ($memcache) { + $memcache->set($name, serialize($value)); + return true; + } else { + return false; + } + } + + /** + * Тестовый метод для чтения из мемкэша + * TODO: переделать + */ + public static function memcacheGet($name) { + $memcache = memcache_connect('localhost', 11211); + + if ($memcache) { + return $memcache->get($name); + } else { + return false; + } + } } ?> \ No newline at end of file