mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-15 17:29:55 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1828 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
5d31f4cba5
commit
3eaea3f33a
106 changed files with 351 additions and 253 deletions
|
|
@ -9,6 +9,28 @@
|
|||
|
||||
var $widget_path = '';
|
||||
|
||||
/**
|
||||
* @brief 위젯 캐시 처리
|
||||
**/
|
||||
function getCache($sequence, $cache) {
|
||||
if(!$sequence || !$cache) return;
|
||||
|
||||
$cache_path = './files/cache/widget_cache/';
|
||||
if(!is_dir($cache_path)) {
|
||||
FileHandler::makeDir($cache_path);
|
||||
return;
|
||||
}
|
||||
|
||||
$cache_file = sprintf('%s%d.%s.cache', $cache_path, $sequence, Context::getLangType());
|
||||
if(!file_exists($cache_file)) return;
|
||||
|
||||
$filectime = filectime($cache_file);
|
||||
if($filectime + $cache*60 < time()) return;
|
||||
|
||||
$output = FileHandler::readFile($cache_file);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 위젯을 찾아서 실행하고 결과를 출력
|
||||
* <div widget='위젯'...></div> 태그 사용 templateHandler에서 WidgetHandler::execute()를 실행하는 코드로 대체하게 된다
|
||||
|
|
@ -32,6 +54,13 @@
|
|||
|
||||
if(__DEBUG__==3) $GLOBALS['__widget_excute_elapsed__'] += getMicroTime() - $start;
|
||||
|
||||
if($args->widget_sequence && $args->widget_cache) {
|
||||
$cache_path = './files/cache/widget_cache/';
|
||||
$cache_file = sprintf('%s%d.%s.cache', $cache_path, $args->widget_sequence, Context::getLangType());
|
||||
|
||||
FileHandler::writeFile($cache_file, $output);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue