mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 04:52:14 +09:00
#645 위젯 캐싱 설정 시 memcache나 apc에 저장할 수 있도록 개선. revert 로 부터 복구
This commit is contained in:
parent
ddd573949b
commit
64e01dea12
1 changed files with 48 additions and 25 deletions
|
|
@ -374,6 +374,21 @@ class widgetController extends widget
|
||||||
return $widget_content;
|
return $widget_content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$oCacheHandler = CacheHandler::getInstance('template');
|
||||||
|
if($oCacheHandler->isSupport())
|
||||||
|
{
|
||||||
|
$key = 'widget_cache:' . $widget_sequence;
|
||||||
|
|
||||||
|
$cache_body = $oCacheHandler->get($key);
|
||||||
|
$cache_body = preg_replace('@<\!--#Meta:@', '<!--Meta:', $cache_body);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($cache_body)
|
||||||
|
{
|
||||||
|
return $cache_body;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* Cache number and cache values are set so that the cache file should call
|
* Cache number and cache values are set so that the cache file should call
|
||||||
*/
|
*/
|
||||||
|
|
@ -402,7 +417,15 @@ class widgetController extends widget
|
||||||
$widget_content = $oWidget->proc($args);
|
$widget_content = $oWidget->proc($args);
|
||||||
$oModuleController = getController('module');
|
$oModuleController = getController('module');
|
||||||
$oModuleController->replaceDefinedLangCode($widget_content);
|
$oModuleController->replaceDefinedLangCode($widget_content);
|
||||||
|
if($oCacheHandler->isSupport())
|
||||||
|
{
|
||||||
|
$oCacheHandler->put($key, $widget_content, $widget_cache * 60);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
FileHandler::writeFile($cache_file, $widget_content);
|
FileHandler::writeFile($cache_file, $widget_content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $widget_content;
|
return $widget_content;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue