#242 자주 사용되는 데이터를 file cache를 이용하도록 개선.

This commit is contained in:
bnu 2014-01-02 06:16:55 +09:00
parent 7f55c5313a
commit 6fb5349c2e
14 changed files with 118 additions and 100 deletions

View file

@ -61,7 +61,7 @@ class moduleController extends module
$output = executeQuery('module.insertTrigger', $args);
//remove from cache
$oCacheHandler = &CacheHandler::getInstance('object', NULL, TRUE);
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
if($oCacheHandler->isSupport())
{
$oCacheHandler->invalidateGroupKey('triggers');
@ -91,7 +91,7 @@ class moduleController extends module
$output = executeQuery('module.deleteTrigger', $args);
//remove from cache
$oCacheHandler = &CacheHandler::getInstance('object', NULL, TRUE);
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
if($oCacheHandler->isSupport())
{
$oCacheHandler->invalidateGroupKey('triggers');
@ -187,7 +187,7 @@ class moduleController extends module
$output = executeQuery('module.insertModuleConfig', $args);
//remove from cache
$oCacheHandler = &CacheHandler::getInstance('object', NULL, TRUE);
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
if($oCacheHandler->isSupport())
{
$cache_key = 'object:module_config:module_'.$module.'_site_srl_'.$site_srl;
@ -211,7 +211,7 @@ class moduleController extends module
if(!$output->toBool()) return $output;
//remove from cache
$oCacheHandler = &CacheHandler::getInstance('object', NULL, TRUE);
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
if($oCacheHandler->isSupport())
{
$cache_key = 'object_module_part_config:'.$module.'_'.$module_srl;
@ -288,7 +288,7 @@ class moduleController extends module
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->index_module_srl);
$mid = $module_info->mid;
$oCacheHandler = &CacheHandler::getInstance('object');
$oCacheHandler = CacheHandler::getInstance('object', null, true);
if($oCacheHandler->isSupport())
{
if($args->site_srl == 0)
@ -554,7 +554,7 @@ class moduleController extends module
foreach($menuOutput->data as $itemInfo)
{
$itemInfo->url = $args->mid;
$updateMenuItemOutput = $oMenuAdminController->updateMenuItem($itemInfo);
if(!$updateMenuItemOutput->toBool())
{
@ -563,7 +563,7 @@ class moduleController extends module
}
}
}
// if mid changed, change mid of success_return_url to new mid
if($module_info->mid != $args->mid && Context::get('success_return_url'))
{
@ -578,7 +578,7 @@ class moduleController extends module
$output->add('module_srl',$args->module_srl);
//remove from cache
$oCacheHandler = &CacheHandler::getInstance('object');
$oCacheHandler = CacheHandler::getInstance('object', null, true);
if($oCacheHandler->isSupport())
{
$cache_key = 'object_module_info:'.$args->module_srl;
@ -722,7 +722,7 @@ class moduleController extends module
// commit
$oDB->commit();
//remove from cache
$oCacheHandler = &CacheHandler::getInstance('object');
$oCacheHandler = CacheHandler::getInstance('object', null, true);
if($oCacheHandler->isSupport())
{
$cache_key = 'object_module_info:'.$args->module_srl;
@ -971,7 +971,7 @@ class moduleController extends module
}
//remove from cache
$oCacheHandler = &CacheHandler::getInstance('object');
$oCacheHandler = CacheHandler::getInstance('object', null, true);
if($oCacheHandler->isSupport())
{
$oCacheHandler->delete($cache_key);
@ -1008,7 +1008,7 @@ class moduleController extends module
$args->module_srl = $module_srl;
return executeQuery('module.deleteModuleExtraVars', $args);
//remove from cache
$oCacheHandler = &CacheHandler::getInstance('object');
$oCacheHandler = CacheHandler::getInstance('object');
if($oCacheHandler->isSupport())
{
$cache_key = 'object:module_extra_vars_'.$module_srl;
@ -1191,7 +1191,7 @@ class moduleController extends module
// Check uploaded file
if(!checkUploadedFile($tmp)) return false;
if(!@move_uploaded_file($tmp, $save_filename))
{
return false;
@ -1228,7 +1228,7 @@ class moduleController extends module
// Check uploaded file
if(!checkUploadedFile($tmp)) return false;
// upload
if(!@move_uploaded_file($tmp, $save_filename))
{

View file

@ -113,7 +113,7 @@ class moduleModel extends module
}
}
$oCacheHandler = &CacheHandler::getInstance('object');
$oCacheHandler = CacheHandler::getInstance('object', null, true);
// If domain is set, look for subsite
if($domain !== '')
{
@ -123,7 +123,7 @@ class moduleModel extends module
$args = new stdClass();
$args->domain = $domain;
$output = executeQuery('module.getSiteInfoByDomain', $args);
if($oCacheHandler->isSupport() && $output->data) $oCacheHandler->put('domain_' . $domain, $output);
if($oCacheHandler->isSupport()) $oCacheHandler->put('domain_' . $domain, $output);
}
if($output->toBool() && $output->data && $vid)
{
@ -135,7 +135,7 @@ class moduleModel extends module
// If no virtual website was found, get default website
if($domain === '')
{
if($oCacheHandler->isSupport()) $output = $oCacheHandler->get('default_site');
if($oCacheHandler->isSupport()) $output = $oCacheHandler->get('default_site');
if(!$output)
{
$args = new stdClass();
@ -194,7 +194,7 @@ class moduleModel extends module
$args = new stdClass();
$args->mid = $mid;
$args->site_srl = (int)$site_srl;
$oCacheHandler = &CacheHandler::getInstance('object');
$oCacheHandler = CacheHandler::getInstance('object', null, true);
if($oCacheHandler->isSupport())
{
$cache_key = 'object:'.$mid.'_'.$site_srl;
@ -288,7 +288,7 @@ class moduleModel extends module
$moduleInfo->designSettings->skin->mobileIsDefault = $moduleInfo->is_mskin_fix == 'N' ? 1 : 0;
$moduleInfo->designSettings->skin->mobile = $skinInfoMobile->title;
$oCacheHandler = &CacheHandler::getInstance('object');
$oCacheHandler = CacheHandler::getInstance('object', null, true);
if($oCacheHandler->isSupport())
{
$cache_key = 'object:'.$mid.'_'.$site_srl;
@ -333,7 +333,7 @@ class moduleModel extends module
// Get data
$args = new stdClass();
$args->module_srl = $module_srl;
$oCacheHandler = &CacheHandler::getInstance('object');
$oCacheHandler = CacheHandler::getInstance('object', null, true);
if($oCacheHandler->isSupport())
{
$cache_key = 'object_module_info:'.$module_srl;
@ -526,7 +526,7 @@ class moduleModel extends module
function getTriggers($trigger_name, $called_position)
{
// cache controll
$oCacheHandler = &CacheHandler::getInstance('object', NULL, TRUE);
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
if($oCacheHandler->isSupport())
{
$object_key = 'object:'.$trigger_name.'_'.$called_position;
@ -1247,7 +1247,7 @@ class moduleModel extends module
function getModuleConfig($module, $site_srl = 0)
{
// cache controll
$oCacheHandler = &CacheHandler::getInstance('object', null, true);
$oCacheHandler = CacheHandler::getInstance('object', null, true);
if($oCacheHandler->isSupport())
{
$cache_key = 'object:module_config:module_'.$module.'_site_srl_'.$site_srl;
@ -1262,11 +1262,11 @@ class moduleModel extends module
$args->site_srl = $site_srl;
$output = executeQuery('module.getModuleConfig', $args);
$config = unserialize($output->data->config);
if(!$config) $config = new stdClass;
//insert in cache
if($oCacheHandler->isSupport())
{
if($config)
$oCacheHandler->put($cache_key,$config);
$oCacheHandler->put($cache_key,$config);
}
$GLOBALS['__ModuleConfig__'][$site_srl][$module] = $config;
}
@ -1283,7 +1283,7 @@ class moduleModel extends module
function getModulePartConfig($module, $module_srl)
{
// cache controll
$oCacheHandler = &CacheHandler::getInstance('object', null, true);
$oCacheHandler = CacheHandler::getInstance('object', null, true);
if($oCacheHandler->isSupport())
{
$cache_key = 'object_module_part_config:'.$module.'_'.$module_srl;
@ -1298,10 +1298,11 @@ class moduleModel extends module
$args->module_srl = $module_srl;
$output = executeQuery('module.getModulePartConfig', $args);
$config = unserialize($output->data->config);
if(!$config) $config = new stdClass;
//insert in cache
if($oCacheHandler->isSupport())
{
if($config) $oCacheHandler->put($cache_key,$config);
$oCacheHandler->put($cache_key, $config);
}
$GLOBALS['__ModulePartConfig__'][$module][$module_srl] = $config;
}
@ -1595,7 +1596,7 @@ class moduleModel extends module
{
if(is_array($module_srl)) $module_srl = implode(',',$module_srl);
// cache controll
$oCacheHandler = &CacheHandler::getInstance('object');
$oCacheHandler = CacheHandler::getInstance('object', null, true);
if($oCacheHandler->isSupport())
{
$cache_key = 'object:module_extra_vars_'.$module_srl;
@ -1718,7 +1719,7 @@ class moduleModel extends module
}
// cache controll
$oCacheHandler = &CacheHandler::getInstance('object');
$oCacheHandler = CacheHandler::getInstance('object', null, true);
if($oCacheHandler->isSupport())
{
$output = $oCacheHandler->get($cache_key);
@ -1765,7 +1766,7 @@ class moduleModel extends module
{
if(!$module_info->module_srl) return;
// cache controll
$oCacheHandler = &CacheHandler::getInstance('object');
$oCacheHandler = CacheHandler::getInstance('object');
if($oCacheHandler->isSupport())
{
$cache_key = 'object_module_mobile_skin_vars:'.$module_info->module_srl;