mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-19 18:32:52 +09:00
#18910823 캐쉬파일 재생성시 디렉토리 삭제 및 cache truncate 실행
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7485 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
fdb236d0d1
commit
19497e2837
11 changed files with 39 additions and 6 deletions
6
classes/cache/CacheHandler.class.php
vendored
6
classes/cache/CacheHandler.class.php
vendored
|
|
@ -19,10 +19,10 @@
|
|||
if(!$info) $info = Context::getDBInfo();
|
||||
if($info){
|
||||
if($target == 'object'){
|
||||
if($info->use_template_cache =='apc') $type = 'apc';
|
||||
else if(substr($info->use_template_cache,0,8)=='memcache'){
|
||||
if($info->use_object_cache =='apc') $type = 'apc';
|
||||
else if(substr($info->use_object_cache,0,8)=='memcache'){
|
||||
$type = 'memcache';
|
||||
$url = $info->use_template_cache;
|
||||
$url = $info->use_object_cache;
|
||||
}
|
||||
}else if($target == 'template'){
|
||||
if($info->use_template_cache =='apc') $type = 'apc';
|
||||
|
|
|
|||
|
|
@ -22,13 +22,18 @@
|
|||
* @return none
|
||||
**/
|
||||
function procAdminRecompileCacheFile() {
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_list = $oModuleModel->getModuleList();
|
||||
// rename cache dir
|
||||
$temp_cache_dir = './files/cache_'. time();
|
||||
FileHandler::rename('./files/cache', $temp_cache_dir);
|
||||
FileHandler::makeDir('./files/cache');
|
||||
|
||||
// remove debug files
|
||||
FileHandler::removeFile(_XE_PATH_.'files/_debug_message.php');
|
||||
FileHandler::removeFile(_XE_PATH_.'files/_debug_db_query.php');
|
||||
FileHandler::removeFile(_XE_PATH_.'files/_db_slow_query.php');
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_list = $oModuleModel->getModuleList();
|
||||
|
||||
// call recompileCache for each module
|
||||
foreach($module_list as $module) {
|
||||
|
|
@ -37,6 +42,25 @@
|
|||
if(method_exists($oModule, 'recompileCache')) $oModule->recompileCache();
|
||||
}
|
||||
|
||||
// remove cache dir
|
||||
FileHandler::removeDir($temp_cache_dir);
|
||||
|
||||
$truncated = array();
|
||||
$oObjectCacheHandler = &CacheHandler::getInstance();
|
||||
$oTemplateCacheHandler = &CacheHandler::getInstance('template');
|
||||
|
||||
if($oObjectCacheHandler->isSupport()){
|
||||
$truncated[] = $oObjectCacheHandler->truncate();
|
||||
}
|
||||
|
||||
if($oTemplateCacheHandler->isSupport()){
|
||||
$truncated[] = $oTemplateCacheHandler->truncate();
|
||||
}
|
||||
|
||||
if(count($truncated) && in_array(false,$truncated)){
|
||||
return new Object(-1,'msg_self_restart_cache_engine');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
|
|
@ -51,4 +75,4 @@
|
|||
header('Location: '.getUrl('module','admin','act',''));
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -82,4 +82,5 @@
|
|||
$lang->ftp_get_list = "Get List";
|
||||
$lang->ftp_remove_info = 'Remove FTP Info.';
|
||||
$lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.';
|
||||
$lang->msg_self_restart_cache_engine = 'Memcached 또는 캐쉬데몬을 재시작 해주세요.';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -84,4 +84,5 @@
|
|||
$lang->ftp_get_list = "Get List";
|
||||
$lang->ftp_remove_info = 'Remove FTP Info.';
|
||||
$lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.';
|
||||
$lang->msg_self_restart_cache_engine = 'Memcached 또는 캐쉬데몬을 재시작 해주세요.';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -83,4 +83,5 @@
|
|||
$lang->ftp_get_list = "Get List";
|
||||
$lang->ftp_remove_info = 'Remove FTP Info.';
|
||||
$lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.';
|
||||
$lang->msg_self_restart_cache_engine = 'Memcached 또는 캐쉬데몬을 재시작 해주세요.';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -82,4 +82,5 @@
|
|||
$lang->ftp_get_list = "Get List";
|
||||
$lang->ftp_remove_info = 'Remove FTP Info.';
|
||||
$lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.';
|
||||
$lang->msg_self_restart_cache_engine = 'Memcached 또는 캐쉬데몬을 재시작 해주세요.';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -82,4 +82,5 @@
|
|||
$lang->ftp_get_list = '목록 가져오기';
|
||||
$lang->ftp_remove_info = 'FTP 정보 삭제';
|
||||
$lang->msg_ftp_invalid_path = 'FTP Path를 읽을 수 없습니다.';
|
||||
$lang->msg_self_restart_cache_engine = 'Memcached 또는 캐쉬데몬을 재시작 해주세요.';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -81,4 +81,5 @@
|
|||
$lang->ftp_get_list = 'Get List';
|
||||
$lang->ftp_remove_info = 'Remove FTP Info';
|
||||
$lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.';
|
||||
$lang->msg_self_restart_cache_engine = 'Memcached 또는 캐쉬데몬을 재시작 해주세요.';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -84,4 +84,5 @@
|
|||
$lang->ftp_get_list = "Get List";
|
||||
$lang->ftp_remove_info = 'Remove FTP Info.';
|
||||
$lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.';
|
||||
$lang->msg_self_restart_cache_engine = 'Memcached 또는 캐쉬데몬을 재시작 해주세요.';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -82,4 +82,5 @@
|
|||
$lang->ftp_get_list = "Get List";
|
||||
$lang->ftp_remove_info = 'Remove FTP Info.';
|
||||
$lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.';
|
||||
$lang->msg_self_restart_cache_engine = 'Memcached 또는 캐쉬데몬을 재시작 해주세요.';
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -82,4 +82,5 @@
|
|||
$lang->ftp_get_list = "取得列表";
|
||||
$lang->ftp_remove_info = '移除 FTP 資料';
|
||||
$lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.';
|
||||
$lang->msg_self_restart_cache_engine = 'Memcached 또는 캐쉬데몬을 재시작 해주세요.';
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue