function cleanup_local()
 {
     $engine = $this->_config->get_string('pgcache.engine');
     switch ($engine) {
         case 'file':
             $w3_cache_file_cleaner = new Cache_File_Cleaner(array('cache_dir' => Util_Environment::cache_blog_dir('page'), 'clean_timelimit' => $this->_config->get_integer('timelimit.cache_gc')));
             $w3_cache_file_cleaner->clean();
             break;
         case 'file_generic':
             if (Util_Environment::blog_id() == 0) {
                 $flush_dir = W3TC_CACHE_PAGE_ENHANCED_DIR;
             } else {
                 $flush_dir = W3TC_CACHE_PAGE_ENHANCED_DIR . '/' . Util_Environment::host();
             }
             $w3_cache_file_cleaner_generic = new Cache_File_Cleaner_Generic(array('exclude' => array('.htaccess'), 'cache_dir' => $flush_dir, 'expire' => $this->_config->get_integer('browsercache.html.lifetime'), 'clean_timelimit' => $this->_config->get_integer('timelimit.cache_gc')));
             $w3_cache_file_cleaner_generic->clean();
             break;
     }
 }
 /**
  * Does disk cache cleanup
  *
  * @return void
  */
 function cleanup()
 {
     $w3_cache_file_cleaner_generic = new Cache_File_Cleaner_Generic(array('exclude' => array('*.files', '.htaccess', 'index.php'), 'cache_dir' => Util_Environment::cache_blog_dir('minify'), 'expire' => $this->_config->get_integer('minify.file.gc'), 'clean_timelimit' => $this->_config->get_integer('timelimit.cache_gc')));
     $w3_cache_file_cleaner_generic->clean();
 }
Exemplo n.º 3
0
 /**
  * Flushes all data
  *
  * @param string  $group Used to differentiate between groups of cache values
  * @return boolean
  */
 function flush($group = '')
 {
     if ($group == 'sitemaps') {
         $config = Dispatcher::config();
         $sitemap_regex = $config->get_string('pgcache.purge.sitemap_regex');
         $this->_flush_based_on_regex($sitemap_regex);
     } else {
         $c = new Cache_File_Cleaner_Generic(array('cache_dir' => $this->_flush_dir, 'exclude' => $this->_exclude, 'clean_timelimit' => $this->_flush_timelimit));
         $c->clean();
     }
 }