Jump to content

手册:DefaultSettings.php

From mediawiki.org
This page is a translated version of the page Manual:DefaultSettings.php and the translation is 83% complete.
Outdated translations are marked like this.

DefaultSettings.php包含了MediaWiki默认的设置信息 默认设置一般存储在MainConfigSchema.php

您不应该编辑DefaultSettings.php,因为在MediaWiki升级时,对它的任何改动都将会丢失。 任何设置都应该写在LocalSettings.php

截至 MediaWiki 1.38,在 LocalSettings.php 中引用 DefaultSettings.php 都会导致如 T311966 一样的错误:

PHP Fatal error:  Uncaught FatalError: $wgBaseDirectory must not be modified in settings files! Use the MW_INSTALL_PATH environment variable to override the installation root directory. in /var/www/html/w/includes/Setup.php:237
Stack trace:
#0 /var/www/html/w/maintenance/doMaintenance.php(96): require_once()
#1 /var/www/html/w/maintenance/update.php(264): require_once('/var/www/html/w...')
#2 {main}
  thrown in /var/www/html/w/includes/Setup.php on line 237

Fatal error: Uncaught FatalError: $wgBaseDirectory must not be modified in settings files! Use the MW_INSTALL_PATH environment variable to override the installation root directory. in /var/www/html/w/includes/Setup.php:237
Stack trace:
#0 /var/www/html/w/maintenance/doMaintenance.php(96): require_once()
#1 /var/www/html/w/maintenance/update.php(264): require_once('/var/www/html/w...')
#2 {main}
  thrown in /var/www/html/w/includes/Setup.php on line 237