我试图找到数据库(tablename.fieldname)中的什么地方存储了性能设置屏幕上显示的“缓存模式”(/ admin/settings/performance)等设置。数据库中存储的Drupal性能设置在哪里?
我看过高速缓存*表,系统,变量和性能*表。
我试图找到数据库(tablename.fieldname)中的什么地方存储了性能设置屏幕上显示的“缓存模式”(/ admin/settings/performance)等设置。数据库中存储的Drupal性能设置在哪里?
我看过高速缓存*表,系统,变量和性能*表。
这些字段位于“变量”表中。您必须至少保存一次设置屏幕才能显示变量。
在文件modules/system/system.admin.inc
中,函数system_performance_settings
中可以看到如何创建“性能设置”窗体。检查#default
属性:有调用variable_get
,所以一些设置存储在variables
表中。
我使用了variable_get()
函数,该函数返回存储在变量表中的所有变量。
您可以使用variable_get('preprocess_css')
和variable_get('preprocess_js')
来检索所需的信息,因为它们存储在变量表中。
你可以简单地自行设置:
variable_set('preprocess_css', 1)
为 '开'variable_set('preprocess_css', 0)
为 '关闭'可能通过增加对两个最佳设置它们的settings.php内以下行简单地在端:
$conf['preprocess_css'] = 1;
˚F或'开'$conf['preprocess_css'] = 0;
for'off'