function cleanup()
 {
     $c = Dispatcher::config();
     $engine = $c->get_string(array('fragmentcache', 'engine'));
     switch ($engine) {
         case 'file':
             $w3_cache_file_cleaner = new Cache_File_Cleaner(array('cache_dir' => Util_Environment::cache_blog_dir('fragment'), 'clean_timelimit' => $c->get_integer('timelimit.cache_gc')));
             $w3_cache_file_cleaner->clean();
             break;
     }
 }
 /**
  * PHP5-style constructor
  *
  * @param array   $config
  */
 function __construct($config = array())
 {
     parent::__construct($config);
     $this->_expire = isset($config['expire']) ? (int) $config['expire'] : 0;
     if (!$this->_expire || $this->_expire > W3TC_CACHE_FILE_EXPIRE_MAX) {
         $this->_expire = 0;
     }
 }
 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;
     }
 }
Ejemplo n.º 4
0
 /**
  * Does disk cache cleanup
  *
  * @return void
  */
 function cleanup()
 {
     $w3_cache_file_cleaner = new Cache_File_Cleaner(array('cache_dir' => Util_Environment::cache_blog_dir('db'), 'clean_timelimit' => $this->_config->get_integer('timelimit.cache_gc')));
     $w3_cache_file_cleaner->clean();
 }