Object cache의 데이터를 삭제하지 못하는 버그 수정

This commit is contained in:
thisgun
2023-03-23 12:00:05 +09:00
parent d603f2d5b3
commit a904c5c634

View File

@ -61,29 +61,39 @@ Class G5_object_cache {
$this->contents[$group][$key] = $data; $this->contents[$group][$key] = $data;
break; break;
default : default :
$datas = $this->etcs[$group][$key] = $data; $this->etcs[$group][$key] = $data;
break; break;
} }
} }
/**
* cache 데이터 제거
* @param string $type
* @param string $key
* @param string $group
* @return bool
* kkigomi 님이 고쳐주심
*/
function delete($type, $key, $group = 'default')
{
if (!$this->exists($type, $key, $group)) {
return false;
}
function delete($key, $group='default') { switch ($type) {
switch ($key) {
case 'bbs': case 'bbs':
$datas = $this->writes; $datas = &$this->writes;
break; break;
case 'content': case 'content':
$datas = $this->contents; $datas = &$this->contents;
break; break;
default : default:
$datas = $this->etcs; $datas = &$this->etcs;
break; break;
} }
if ( ! $this->exists('bbs', $key, $group) ) unset($datas[$group][$key]);
return false;
unset( $datas[$group][$key] );
return true; return true;
} }