fix #424 중복 설정된 cache 설정 제거

This commit is contained in:
bnu 2014-03-10 14:10:50 +09:00
parent c40fda8951
commit 0bd8a16194
3 changed files with 9 additions and 48 deletions

View file

@ -262,15 +262,8 @@ class layoutAdminController extends layout
$oLayoutModel = getModel('layout'); $oLayoutModel = getModel('layout');
$cache_file = $oLayoutModel->getUserLayoutCache($args->layout_srl, Context::getLangType()); $cache_file = $oLayoutModel->getUserLayoutCache($args->layout_srl, Context::getLangType());
FileHandler::removeFile($cache_file); FileHandler::removeFile($cache_file);
//remove from cache
$oCacheHandler = CacheHandler::getInstance('object', null, true);
if($oCacheHandler->isSupport())
{
$object_key = 'layout:' . $args->layout_srl;
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
$oCacheHandler->delete($cache_key);
}
} }
return $output; return $output;
} }
@ -336,14 +329,7 @@ class layoutAdminController extends layout
$args = new stdClass(); $args = new stdClass();
$args->layout_srl = $layout_srl; $args->layout_srl = $layout_srl;
$output = executeQuery("layout.deleteLayout", $args); $output = executeQuery("layout.deleteLayout", $args);
//remove from cache
$oCacheHandler = CacheHandler::getInstance('object', null, true);
if($oCacheHandler->isSupport())
{
$object_key = 'layout:'.$layout_srl;
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
$oCacheHandler->delete($cache_key);
}
if(!$output->toBool()) return $output; if(!$output->toBool()) return $output;
return new Object(0,'success_deleted'); return new Object(0,'success_deleted');

View file

@ -86,8 +86,6 @@ class layout extends ModuleObject
$oDB->addColumn('layouts','layout_type','char',1,'P',true); $oDB->addColumn('layouts','layout_type','char',1,'P',true);
} }
$oCacheHandler = CacheHandler::getInstance('object', null, true);
$args->layout = '.'; $args->layout = '.';
$output = executeQueryArray('layout.getLayoutDotList', $args); $output = executeQueryArray('layout.getLayoutDotList', $args);
if($output->data && count($output->data) > 0) if($output->data && count($output->data) > 0)
@ -101,13 +99,6 @@ class layout extends ModuleObject
$args->layout = implode('|@|', $layout_path); $args->layout = implode('|@|', $layout_path);
$args->layout_srl = $layout->layout_srl; $args->layout_srl = $layout->layout_srl;
$output = executeQuery('layout.updateLayout', $args); $output = executeQuery('layout.updateLayout', $args);
if($oCacheHandler->isSupport())
{
$object_key = 'layout:' . $args->layout_srl;
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
$oCacheHandler->delete($cache_key);
}
} }
} }
} }

View file

@ -258,31 +258,15 @@ class layoutModel extends layout
*/ */
function getLayout($layout_srl) function getLayout($layout_srl)
{ {
$layout_info = false; // Get information from the DB
$args = new stdClass();
$args->layout_srl = $layout_srl;
$output = executeQuery('layout.getLayout', $args);
if(!$output->data) return;
// cache controll // Return xml file informaton after listing up the layout and extra_vars
$oCacheHandler = CacheHandler::getInstance('object', null, true); $layout_info = $this->getLayoutInfo($layout, $output->data, $output->data->layout_type);
if($oCacheHandler->isSupport())
{
$object_key = 'layout:' . $layout_srl;
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
$layout_info = $oCacheHandler->get($cache_key);
}
if($layout_info === false)
{
// Get information from the DB
$args = new stdClass();
$args->layout_srl = $layout_srl;
$output = executeQuery('layout.getLayout', $args);
if(!$output->data) return;
// Return xml file informaton after listing up the layout and extra_vars
$layout_info = $this->getLayoutInfo($layout, $output->data, $output->data->layout_type);
//insert in cache
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $layout_info);
}
return $layout_info; return $layout_info;
} }