#190 각 모듈의 class파일에 recompileCache() method 추가하고 admin모듈에서 모든 모듈의 recompileCache() method를 호출하게 하여 깔끔한 캐시파일 재정리가 가능하도록 기능 추가

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2664 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-10-02 06:51:33 +00:00
parent 2b8fca8654
commit 6647883063
34 changed files with 256 additions and 2 deletions

View file

@ -55,5 +55,19 @@
$output = executeQuery('admin.insertShortCut', $args);
return $output;
}
/**
* @brief 모든 캐시 파일 재생성
**/
function procAdminRecompileCacheFile() {
$oModuleModel = &getModel('module');
$module_list = $oModuleModel->getModuleList();
foreach($module_list as $module) {
$oModule = null;
$oModule = &getClass($module->module);
if(method_exists($oModule, 'recompileCache')) $oModule->recompileCache();
}
}
}
?>

View file

@ -42,5 +42,29 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
// 템플릿 컴파일 파일 삭제
FileHandler::removeFilesInDir("./files/cache/template_compiled");
// optimized 파일 삭제
FileHandler::removeFilesInDir("./files/cache/optimized");
// js_filter_compiled 파일 삭제
FileHandler::removeFilesInDir("./files/cache/js_filter_compiled");
// queries 파일 삭제
FileHandler::removeFilesInDir("./files/cache/queries");
// ./files/cache/news* 파일 삭제
$directory = dir("./files/cache/");
while($entry = $directory->read()) {
if(substr($entry,0,11)=='newest_news') @unlink("./files/cache/".$entry);
}
$directory->close();
}
}
?>

View file

@ -6,5 +6,6 @@
<action name="procAdminInsertShortCut" type="controller" standalone="true" />
<action name="procAdminDeleteShortCut" type="controller" standalone="true" />
<action name="procAdminRecompileCacheFile" type="controller" standalone="true" />
</actions>
</module>

View file

@ -67,12 +67,15 @@
</td>
</tr>
</table>
<div class="tRight gap1">
<div class="fl tLeft gap1">
<span class="button"><input type="button" value="{$lang->cmd_remake_cache}" onclick="doRecompileCacheFile(); return false;"/></span>
</div>
<div class="fr tRight gap1">
<span class="button"><input type="submit" value="{$lang->cmd_save}" /></span>
</div>
</form>
<div class="admin_news">
<div class="admin_news clear">
<!--@if($news)-->
<table cellspacing="0" class="tableType1">
<caption>{$lang->newest_news}</caption>

View file

@ -29,3 +29,8 @@ function fixAdminNaviHeight() {
else xHeight('content',naviHeight);
setTimeout(fixAdminNaviHeight, 500);
}
// 캐시파일 모두 재 생성
function doRecompileCacheFile() {
exec_xml("admin","procAdminRecompileCacheFile");
}