mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-08-30 12:45:32 +08:00
改进缓存标签的设置和删除
This commit is contained in:
12
library/think/cache/Driver.php
vendored
12
library/think/cache/Driver.php
vendored
@@ -80,6 +80,17 @@ abstract class Driver
|
||||
*/
|
||||
abstract public function clear($tag = null);
|
||||
|
||||
/**
|
||||
* 获取实际的缓存标识
|
||||
* @access public
|
||||
* @param string $name 缓存名
|
||||
* @return string
|
||||
*/
|
||||
protected function getCacheKey($name)
|
||||
{
|
||||
return $this->options['prefix'] . $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存标签
|
||||
* @access public
|
||||
@@ -96,6 +107,7 @@ abstract class Driver
|
||||
if (is_string($keys)) {
|
||||
$keys = explode(',', $keys);
|
||||
}
|
||||
$keys = array_map([$this, 'getCacheKey'], $keys);
|
||||
$value = array_unique(array_merge($this->getTagItem($name), $keys));
|
||||
$this->set($key, implode(',', $value));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user