Issue 145

modify recompileCache() in modules


git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8984 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2011-09-02 04:44:12 +00:00
parent bd6be95b08
commit 35a23caba8
12 changed files with 12 additions and 61 deletions

View file

@ -63,7 +63,6 @@
* @brief Re-generate the cache file
**/
function recompileCache() {
FileHandler::removeFilesInDir('./files/cache/addons');
}
}

View file

@ -42,14 +42,7 @@
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);
}
}
// remove cache
$truncated = array();
$oObjectCacheHandler = &CacheHandler::getInstance('object');
$oTemplateCacheHandler = &CacheHandler::getInstance('template');
@ -66,6 +59,15 @@
return new Object(-1,'msg_self_restart_cache_engine');
}
// 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);
}
}
$this->setMessage('success_updated');
}

View file

@ -45,25 +45,6 @@
* @return none
**/
function recompileCache() {
// remove compiled templates
FileHandler::removeFilesInDir("./files/cache/template_compiled");
// remove optimized files
FileHandler::removeFilesInDir("./files/cache/optimized");
// remove js_filter_compiled files
FileHandler::removeFilesInDir("./files/cache/js_filter_compiled");
// remove cached queries
FileHandler::removeFilesInDir("./files/cache/queries");
// remove ./files/cache/news* files
$directory = dir(_XE_PATH_."files/cache/");
while($entry = $directory->read()) {
if(substr($entry,0,11)=='newest_news') FileHandler::removeFile("./files/cache/".$entry);
}
$directory->close();
}
/**

View file

@ -296,8 +296,6 @@
* @brief Re-generate the cache file
**/
function recompileCache() {
// Delete the cache files of document_category
FileHandler::removeFilesInDir(_XE_PATH_."files/cache/document_category");
}
/**

View file

@ -100,8 +100,6 @@
* @brief Re-generate the cache file
**/
function recompileCache() {
// Delete the cache file editor component
FileHandler::removeFilesInDir("./files/cache/editor");
}
}
?>

View file

@ -71,19 +71,11 @@
* @brief Re-generate the cache file
**/
function recompileCache() {
// Remove layout cache(modified layout is not deleted)
$path = './files/cache/layout';
if(!is_dir($path)) {
FileHandler::makeDir($path);
return;
}
$directory = dir($path);
while($entry = $directory->read()) {
if ($entry == "." || $entry == ".." || preg_match('/\.html$/i',$entry) ) continue;
FileHandler::removeFile($path."/".$entry);
}
$directory->close();
}
}
?>

View file

@ -45,9 +45,6 @@
* @brief Re-generate the cache file
**/
function recompileCache() {
// Delete all cache files in the menu module
FileHandler::removeFilesInDir("./files/cache/menu");
$oMenuAdminController = &getAdminController('menu');
// Wanted list of all the blog module
$output = executeQueryArray("menu.getMenus");

View file

@ -346,14 +346,8 @@
* @brief Re-generate the cache file
**/
function recompileCache() {
// Delete all cache files, the module information
FileHandler::removeFilesInDir("./files/cache/module_info");
// Delete all the files that trigger information
FileHandler::removeFilesInDir("./files/cache/triggers");
// DB cache, delete all the files
FileHandler::removeFilesInDir("./files/cache/db");
// Other Cache
FileHandler::removeDir("./files/cache/tmp");
$oModuleModel = &getModel('module');
$oModuleModel->getModuleList();
}
}
?>

View file

@ -38,8 +38,6 @@
* @brief Re-generate the cache file
**/
function recompileCache() {
// Remove cache file for external pages
FileHandler::removeFilesInDir("./files/cache/opage");
}
}
?>

View file

@ -72,8 +72,6 @@
* @brief Re-generate the cache file
**/
function recompileCache() {
// Delete the cache file pages
FileHandler::removeFilesInDir("./files/cache/page");
}
}
?>

View file

@ -76,8 +76,6 @@
* @brief Re-generate the cache file
**/
function recompileCache() {
// Delete an existing file-based session
FileHandler::removeDir(_XE_PATH_."files/sessions");
}
}
?>

View file

@ -50,10 +50,6 @@
* @brief Re-generate the cache file
**/
function recompileCache() {
// delete the cache files containing information widget
FileHandler::removeFilesInDir("./files/cache/widget");
// delete the cache files created widget
FileHandler::removeFilesInDir("./files/cache/widget_cache");
}
}