手册:配置设定

From mediawiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:Configuration settings and the translation is 5% complete.
Other languages:
Bahasa Indonesia • ‎Deutsch • ‎English • ‎Türkçe • ‎dansk • ‎español • ‎français • ‎magyar • ‎polski • ‎português • ‎português do Brasil • ‎svenska • ‎русский • ‎中文 • ‎日本語 • ‎한국어

这是 DefaultSettings.php 支持的所有配置设定的帮助。

Never edit DefaultSettings.php; copy appropriate lines to LocalSettings.php instead and amend them as appropriate.

If you can't find a configuration setting here, see if it is defined in DefaultSettings.php. The variable should have some documentation there.

Settings removed in versions of MediaWiki prior to 1.27 are no longer listed here. Please use the search box to find the relevant manual page (e.g. Manual:$wgAllowAnonymousMinor).
Listed alphabetically | Listed by function | 分类:MediaWiki配置设置

通用设置

URLs and file paths

Global Objects

邮件设置

See also User Access: $wgEmailConfirmToEdit

Email notification (Enotif) settings

Actual notifications for each user are defined in the options. You can change defaults with $wgDefaultUserOptions .

Database settings

LoadBalancer settings

MSSQL-specific

MySQL-specific

  • $wgDBmysql5 (在1.33版本中已移除) – Set to true to set MySQL connection into UTF-8 encoding (experimental)
  • $wgDBTableOptions – 在安装及更新过程中使用的MySQL表选项。
  • $wgExternalServers – An array of external MySQL servers.
  • $wgSQLMode Value for the MySQL sql_mode parameter

Oracle-specific

  • $wgDBOracleDRCP (在1.34版本中已移除) – When set to true, enables persistent connection with DRCP on Oracle.

PostgreSQL-specific

  • $wgDBport – 数据库端口。只用于PostgreSQL。

SQLite-specific

Shared DB settings

Compressed Storage Support

Migration

Extension fields

Localization

  • $wgDisabledVariants – Disabled variants for language variant conversion.
  • $wgDisableLangConversion – Whether to enable language variant conversion.
  • $wgDisableTitleConversion – Whether to enable language variant conversion for links.
  • $wgDummyLanguageCodes (在1.29版本中已弃用)List of language codes that have been renamed to new (correct) codes, or don't correspond to an actual interface language.
  • $wgEditEncoding (在1.28版本中已移除) – Characters not explicitly converted by output encoding
  • $wgExtraLanguageCodes – List of mappings from one language code to another
  • $wgForceUIMsgAsContentMsg – Array of UI messages that should be treated as content messages.
  • $wgInterwikiMagic – Treat language links as magic connectors, not inline links.
  • $wgLangObjCacheSize – Language cache size, or really how many languages can we handle simultaneously without degrading to crawl speed.
  • $wgLanguageCode – 网站语言代码。
  • $wgLegacyEncoding – Set this to the character set, which you used before you updated to MediaWiki 1.5 (eg 'ISO-8859-1'). MediaWiki will then perform a temporary character set conversion when loading old revisions, which are not marked with "utf-8" flag (revisions created with MediaWiki 1.4 and earlier).
  • $wgMsgCacheExpiry (在1.34版本中已移除) – When a message in cache expires (in seconds).
  • $wgOverrideUcfirstCharacters (引入 自 1.34) – List of Unicode characters for which capitalization is overridden in Language::ucfirst.
  • $wgRawHtmlMessages (引入 自 1.32) – 可能包含原始HTML的訊息列表。
  • $wgUseDatabaseMessages – 使用MediaWiki:命名空间翻译
  • $wgUserFallbackLanguages maximum number of fallback languages per user

Timezone settings

Language-specific

English
  • $wgAmericanDates – Use 'mdy' instead of 'dmy' as the default date format, e.g. 'May 12' instead of '12 May'.
Arabic/Hindi
  • $wgTranslateNumerals – For Hindi, Arabic, and other languages with their own numeral systems, use local numerals instead of Western style (0-9) numerals in some areas of the interface.

Debug/logging

See also: 手册:如何调试

Profiling

  • $wgEnableProfileInfo (在1.35版本中已移除) – Controls the availability of profileinfo.php.
  • $wgProfiler Settings related to profiling.
  • $wgProfileCallTree (在1.27版本中已移除) – 如果为true,则打印原始调用树而不是按功能报告
  • $wgProfileLimit (在1.35版本中已移除)Only record profiling info for pages that took longer than this number of seconds to load.
  • $wgProfileOnly (在1.35版本中已移除) – 不要将非分析信息放入日志文件
  • $wgProfilePerHost (在1.27版本中已移除) – Should the application server hostname be stored in the profiling table?
  • $wgUDPProfilerHost (在1.27版本中已移除) – UDP探查器的主机。
  • $wgUDPProfilerPort (在1.27版本中已移除) – UDP探查器的端口。
  • $wgUDPProfilerFormatString (在1.27版本中已移除) – Format string for UDP profiler.

Site customization

Ajax

Frontend

ResourceLoader

See ResourceLoader for more information.

Namespaces

Output

The following setting is no longer used in supported versions of MediaWiki, but still exists for backward compatibility

Robot policies

Mobile support

Content Security Policy

  • $wgCSPHeader (引入 自 1.32) – Controls Content-Security-Policy header [Experimental]
  • $wgCSPReportOnlyHeader (引入 自 1.32) – Controls Content-Security-Policy-Report-Only header [Experimental]
  • $wgCSPFalsePositiveUrls – Controls what URLs to ignore in upcoming Content-Security-Policy feature's reporting.

ContentHandler

Site Statistics

Skins

Category

Cache

See: Interwiki for Interwiki cache settings.

Client side caching

File Cache

Settings for Server side file caching.

Message Cache

Sidebar Cache

Parser Cache

Memcached settings

Settings for configuring the Memcached memory-based object store (if you are using it) docs/memcached.txt has more details.

WAN cache

Interwiki

Interwiki cache

See interwiki cache for more information.

Access

Wiki locking, blocking/banning, and some other related settings.

See 手册:阻止访问 for more methods and settings concerning access. See also 手册:用户权限 for more information about $wgGroupPermissions, $wgAddGroups, $wgRemoveGroups, etc.

See User Access for User Access settings.

Rate limiter

  • $wgRateLimitLog (在1.27版本中已移除) – Set to a filename to log rate limiter hits.
  • $wgRateLimits – 简单的速率限制器选项可以用于制动大量编辑。
  • $wgRateLimitsExcludedIPs – Array of IPs/CIDR ranges which should never trigger the rate limiter.

API

Wiki locking

Reduction

Uploads

Uploads have to be specially set up to be secure.

Shared uploads

These settings are kept for backward compatibility, see $wgForeignFileRepos for the new setting, or $wgUseInstantCommons if you only need read access to images on Commons.

MIME types

警告 警告: This is not a configuration setting, but a global state variable. It should be used solely by thumb.php!

See also: Manual:Mime type detection

Images

See also: 手册:配置文件上传

DjVu

EXIF

  • $wgShowEXIF – Show EXIF data at the end of file description pages.
  • $wgUpdateCompatibleMetadata – Whether to automatically update the img_metadata field if it is outdated but compatible with the current version.

ImageMagick

Set $wgUseImageMagick to true to use ImageMagick instead of the builtin functions.

SVG

Thumbnail settings

Antivirus

Parser

HTML

  • $wgRawHtml – 允许原始没有经过检查的HTML放在<html>...</html>里。

Tidy

Tidy is an open source tool that cleans up broken HTML. You can use this to ensure that broken HTML in articles doesn't affect the layout of your wiki. While Tidy itself is going to be replaced, the configuration settings can still be used for the replacements. Template:Update inline

  • $wgTidyConfig – Configuration of the HTML postprocessing tool to use for fixing invalid HTML code.
  • $wgDebugTidy (在1.33版本中已移除) – Put tidy warnings in HTML comments, only works for internal tidy.
  • $wgTidyBin (在1.33版本中已移除) – Should be set to the path of the tidy binary.
  • $wgTidyConf (在1.33版本中已移除) – Should be set to the path of the tidy configuration file.
  • $wgTidyInternal (在1.33版本中已移除) – Controls the use of the tidy extension to use an in-process tidy library instead of spawning a separate program.
  • $wgTidyOpts (在1.33版本中已移除)Options passed to tidy on the command line.
  • $wgUseTidy (在1.33版本中已移除) – Use tidy to make sure HTML output is sane.
  • $wgValidateAllHtml (在1.31版本中已移除) – Validate the overall output using tidy and refuse to display the page if it's not valid.
See also: Manual:Build Tidy from source .

Special pages

Recent changes

See also Help:最近更改 and $wgDefaultUserOptions

UDP updates

Send Recent changes updates via UDP. See: Manual:Simple IRC RC Bot

Users

Authentication

User Access

User agent

  • $wgBrowserBlackList (在1.30版本中已弃用) – 不兼容Unicode的浏览器的浏览器黑名单。

Cookies

Feed

  • $wgFeed – Toggle syndication feeds (RSS, Atom e.g. Recentchanges, Newpages) on and off.
  • $wgAdvertisedFeedTypes – Feed types that should be provided by default.
  • $wgFeedCacheTimeout – Minimum timeout for cached Recentchanges feed, in seconds.
  • $wgFeedClasses – Available feeds objects.
  • $wgFeedDiffCutoff – When generating Recentchanges RSS/Atom feed, diffs will not be generated for pages larger than this size.
  • $wgFeedLimit – Set maximum number of results to return in syndication feeds (RSS, Atom) for eg Recentchanges, Newpages.
  • $wgOverrideSiteFeed – Override the site's default rss/atom feed that appears on every page.

Copyright

搜索

HTTP client

Jobs

Proxies

CDN / Squid

These settings configure MediaWiki when using a caching HTTP proxy server. They apply to caching using Varnish as well as Squid.

  • $wgEventRelayerConfig – Mapping of event channels (or channel categories) to EventRelayer configuration.
  • $wgInternalServer – Squid已知的内部服务器名称(如果不同于$wgServer )。
  • $wgMaxSquidPurgeTitles (在1.27版本中已移除) – Maximum number of titles to purge in any one client operation
  • $wgSquidPurgeUseHostHeader (在1.33版本中已弃用) – Whether to use a Host header in purge requests sent to the proxy servers configured in $wgSquidServers.
  • $wgSquidMaxage (在1.35版本中已移除) – Cache timeout for the squid.
  • $wgCdnMaxAge (引入 自 1.34) – Cache TTL for the CDN sent as s-maxage (without ESI) or Surrogate-Control (with ESI).
  • $wgCdnMaxageLagged – Cache timeout for the CDN when DB replica lag is high
  • $wgCdnMaxageStale (引入 自 1.35) – Cache timeout in seconds when delivering a stale ParserCache response due to PoolCounter contention.
  • $wgCdnMaxageSubstitute – Cache timeout for the CDN when a response is known to be wrong or incomplete (due to load)
  • $wgCdnReboundPurgeDelay – Secondary delayed purges of URLs
  • $wgSquidServers (在1.35版本中已移除) – An array of individual proxy servers to help MediaWiki detect if the request has been proxyed.
    But also to send back to the proxy PURGE commands on changes.
  • $wgCdnServers (引入 自 1.34)An array of individual proxy servers to help MediaWiki detect if the request has been proxyed.
    But also to send back to the proxy PURGE commands on changes.
  • $wgSquidServersNoPurge (在1.35版本中已移除) – Same as $wgSquidServers , except that MW has no methods to send HTTP PURGE to an origin part of the configured ranges
  • $wgCdnServersNoPurge (引入 自 1.34) – Same as $wgCdnServers , except that MW has no methods to send HTTP PURGE to an origin part of the configured ranges
  • $wgLoggedOutMaxAge (引入 自 1.35) – 对于已登出用户,以最大寿命发送的用户代理缓存TTL。
  • $wgUseESI (在1.33版本中已弃用) – If you run Squid3 with ESI support, enable this.
  • $wgUseSquid (在1.35版本中已移除) – 启用/禁用Squid。
  • $wgUseCdn (引入 自 1.34) – Enable/disable page view caching.
  • $wgUseKeyHeader (在1.34版本中已移除) – Send the Key HTTP header for better caching.
  • $wgUseXVO (在1.27版本中已移除) – Send X-Vary-Options header for better caching (requires patched Squid).
  • $wgVaryOnXFP – Whether to add X-Forwarded-Proto to the Vary header for API requests and RSS/Atom feeds.

HTCP multicast purging

Extensions

Maintenance Scripts setting

Miscellaneous settings

參見