From 5625b8cfd2a53f24c99e43f0b8fa0bde27039ce8 Mon Sep 17 00:00:00 2001 From: rsgrinko Date: Fri, 10 Dec 2021 23:10:59 +0300 Subject: [PATCH] =?UTF-8?q?[*]=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B8=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=20=D0=BC=D0=B5=D1=82=D0=BE?= =?UTF-8?q?=D0=B4=20=D0=BE=D1=87=D0=B8=D1=81=D1=82=D0=BA=D0=B8=20=D0=BA?= =?UTF-8?q?=D1=8D=D1=88=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- editprofile.php | 2 +- inc/bootstrap.php | 2 +- inc/lib/CCache.class.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editprofile.php b/editprofile.php index ebeb1ca..8a5de32 100644 --- a/editprofile.php +++ b/editprofile.php @@ -16,7 +16,7 @@ $cacheId = md5('CUser::getFields_' . $userId); if(isset($_REQUEST['save']) and $_REQUEST['save'] == 'Y'): $DB->update('users', array('id' => $userId), array('name' => $_REQUEST['name'], 'email' => $_REQUEST['email'], 'image' => $_REQUEST['image'])); - CCache::delFromCache($cacheId); + CCache::del($cacheId); CEvents::add('Изменен профиль пользователя с ID: '.$userId.', инициатор ID: '.CUser::$id.' ('.$USER['login'].')', 'notice', 'user'); echo ''; endif; diff --git a/inc/bootstrap.php b/inc/bootstrap.php index 9a134ea..b38ad49 100644 --- a/inc/bootstrap.php +++ b/inc/bootstrap.php @@ -31,7 +31,7 @@ CIoT::init($DB); // инициализация класса раб CCache::init(CACHEDIR, USE_CACHE); // инициализация модуля кэширования if(isset($_REQUEST['clear_cache']) and $_REQUEST['clear_cache'] =='Y') { // сброс кэша по запросу - CCache::clearCache(); + CCache::flush(); } CUser::init($DB); // инициализация поддержки пользователей панели diff --git a/inc/lib/CCache.class.php b/inc/lib/CCache.class.php index 8f50dcb..7f9ec39 100644 --- a/inc/lib/CCache.class.php +++ b/inc/lib/CCache.class.php @@ -121,7 +121,7 @@ class CCache * * @return bool Флаг успеха */ - public static function clearCache():bool + public static function flush():bool { // Очистить кэш foreach (scandir(self::$cache_dir) as $file) { if ($file == '.' or $file == '..') continue; @@ -140,7 +140,7 @@ class CCache * @param string $name Имя элемента кэша * @return bool Флаг успеха */ - public static function delFromCache($name):bool + public static function del($name):bool { // Удалить элемент из кэша if (self::checkCache($name)) { if (!unlink(self::$cache_dir . md5($name) . '.tmp')) {