示例#1
0
 /**
  * cleans out all the cache folders
  * @return bool
  */
 function upgrade()
 {
     // work our way through all the tmp files and remove them
     $files = array(BASE . 'tmp/css', BASE . 'tmp/minify', BASE . 'tmp/pixidou', BASE . 'tmp/rsscache', BASE . 'tmp/views_c', BASE . 'tmp/cache', BASE . 'tmp/img_cache', BASE . 'tmp/extensionuploads');
     // delete the files.
     $removed = 0;
     $errors = 0;
     foreach ($files as $file) {
         if (file_exists($file)) {
             $files = expFile::removeFilesInDirectory($file);
             $removed += count($files['removed']);
             $errors += count($files['not_removed']);
         }
     }
     return gt("All Caches were cleared.") . "<br>" . $errors . " " . gt("files could not be removed.");
 }
示例#2
0
 public static function removeSmartyCache()
 {
     expFile::removeFilesInDirectory(BASE . 'tmp/cache');
     // alt location for cache
     return expFile::removeFilesInDirectory(BASE . 'tmp/views_c');
 }
 public function clear_all_caches()
 {
     expTheme::removeSmartyCache();
     expTheme::removeCss();
     expFile::removeFilesInDirectory(BASE . 'tmp/pixidou');
     if (file_exists(BASE . 'tmp/img_cache')) {
         expFile::removeFilesInDirectory(BASE . 'tmp/img_cache');
     }
     if (file_exists(BASE . 'tmp/extensionuploads')) {
         expFile::removeFilesInDirectory(BASE . 'tmp/extensionuploads');
     }
     expFile::removeFilesInDirectory(BASE . 'tmp/rsscache');
     flash('message', gt("All the System Caches have been cleared"));
     expHistory::back();
 }