欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

清空所有缓存 清空全部缓存 有大用 有大大用

function shipingzhongcustom_clear_xgz_and_yxwgz_cache(){
  cache_clear_all('*', 'cache', TRUE);//这就是清空 cache 表里的所有缓存吧
  drupal_goto($_SERVER['HTTP_REFERER']);
  exit;
}


$core = array('cache', 'cache_block', 'cache_filter', 'cache_page');
$cache_tables = array_merge(module_invoke_all('flush_caches'), $core);  //这个好像是清空 所有表( 其中肯定有 cache, cache_block,cache_filter,cache_page )的所有缓存
foreach ($cache_tables as $table) {
 cache_clear_all('*', $table, TRUE);
}


普通分类: