只有在关闭缓存时,我才愿意在模块中设置一些功能。
是否有一种方法可以签入代码,缓存是打开还是关闭?
发布于 2012-03-04 13:26:28
“匿名用户缓存页”设置存储在变量表中(作为0或1),您可以这样获得:
if (variable_get('cache', 0)) {
// Cache is turned on
}如果您对“缓存块”设置感兴趣,那么它也在变量表中,您可以这样得到它:
if (variable_get('block_cache', 0)) {
// Block cache is turned on
}仅供参考,第一个在system_performance_settings()中定义,第二个在block_form_system_performance_settings_alter()中定义。
https://drupal.stackexchange.com/questions/24354
复制相似问题