#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

@ -117,6 +117,14 @@
@rmdir($path);
}
/**
* @biref 지정된 디렉토리를 제외한 모든 파일을 삭제
**/
function removeFilesInDir($path) {
FileHandler::removedir($path);
FileHandler::makeDir($path);
}
/**
* @brief byte단위의 파일크기를 적절하게 변환해서 return
**/

View file

@ -50,5 +50,13 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
$oAddonController = &getAdminController('addon');
$oAddonController->makeCacheFile();
}
}
?>

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");
}

View file

@ -49,5 +49,28 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
// 블로그 모듈의 캐시 파일 모두 삭제
FileHandler::removeFilesInDir("./files/cache/blog_category");
$oModuleModel = &getModel('module');
$oBlogAdminController = &getAdminController('blog');
// 블로그 모듈 목록을 모두 구함
$args->module = 'blog';
$output = executeQueryArray("module.getMidList", $args);
$list = $output->data;
if(!count($list)) return;
// 블로그 모듈에서 사용되는 모든 메뉴 목록을 재 생성
foreach($list as $blog_item) {
$module_srl = $blog_item->module_srl;
$oBlogAdminController->makeXmlFile($module_srl);
}
}
}
?>

View file

@ -73,5 +73,10 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -32,5 +32,10 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -40,5 +40,10 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -105,5 +105,10 @@
return new Object(0,'success_updated');
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -48,5 +48,13 @@
function moduleUpdate() {
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
// 에디터 컴포넌트 캐시 파일 삭제
FileHandler::removeFilesInDir("./files/cache/editor");
}
}
?>

View file

@ -45,5 +45,11 @@
function moduleUpdate() {
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -55,5 +55,10 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -32,5 +32,10 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -28,5 +28,10 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -43,5 +43,10 @@
return new Object(0, 'success_updated');
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -36,5 +36,10 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -39,5 +39,11 @@
function moduleUpdate() {
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -154,5 +154,11 @@
return new Object(0, 'success_updated');
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -36,5 +36,26 @@
function moduleUpdate() {
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
// 메뉴 모듈의 캐시 파일 모두 삭제
FileHandler::removeFilesInDir("./files/cache/menu");
$oMenuAdminController = &getAdminController('menu');
// 블로그 모듈 목록을 모두 구함
$output = executeQueryArray("menu.getMenus");
$list = $output->data;
if(!count($list)) return;
// 메뉴 모듈에서 사용되는 모든 메뉴 목록을 재 생성
foreach($list as $menu_item) {
$menu_srl = $menu_item->menu_srl;
$oMenuAdminController->makeXmlFile($menu_srl);
}
}
}
?>

View file

@ -33,5 +33,10 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -38,5 +38,12 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
// 모듈 정보 캐시 파일 모두 삭제
FileHandler::removeFilesInDir("./files/cache/module_info");
}
}
?>

View file

@ -66,5 +66,12 @@
return new Object(0, 'success_updated');
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
// 외부 페이지 캐시 파일 삭제
FileHandler::removeFilesInDir("./files/cache/opage");
}
}
?>

View file

@ -40,5 +40,12 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
// 페이지 캐시 파일 삭제
FileHandler::removeFilesInDir("./files/cache/page");
}
}
?>

View file

@ -89,5 +89,14 @@
return new Object(0, 'success_updated');
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
// point action 파일 재정의
$oPointAdminController = &getAdminController('point');
$oPointAdminController->cacheActList();
}
}
?>

View file

@ -39,5 +39,10 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -32,5 +32,10 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -34,5 +34,10 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -28,5 +28,10 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -33,5 +33,10 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -32,5 +32,10 @@
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
}
}
?>

View file

@ -37,5 +37,16 @@
function moduleUpdate() {
return new Object();
}
/**
* @brief 캐시 파일 재생성
**/
function recompileCache() {
// widget 정보를 담은 캐시 파일 삭제
FileHandler::removeFilesInDir("./files/cache/widget");
// widget 생성 캐시 파일 삭제
FileHandler::removeFilesInDir("./files/cache/widget_cache");
}
}
?>