update trunk / tag 1.4.2.2

git-svn-id: http://xe-core.googlecode.com/svn/trunk@7492 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
haneul 2010-05-27 07:35:42 +00:00
parent d448678c63
commit 6900f96319
27 changed files with 99 additions and 54 deletions

View file

@ -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,30 @@
if(method_exists($oModule, 'recompileCache')) $oModule->recompileCache();
}
// remove cache dir
$tmp_cache_list = FileHandler::readDir('./files','/(^cache_[0-9]+)/');
if($tmp_cache_list){
foreach($tmp_cache_list as $tmp_dir){
if($tmp_dir) FileHandler::removeDir('./files/'.$tmp_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 +80,4 @@
header('Location: '.getUrl('module','admin','act',''));
}
}
?>
?>