手册:配置设定

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 6% complete.
Other languages:
Bahasa Indonesia • ‎Deutsch • ‎English • ‎Türkçe • ‎dansk • ‎español • ‎français • ‎italiano • ‎magyar • ‎polski • ‎português • ‎português do Brasil • ‎svenska • ‎čeština • ‎русский • ‎中文 • ‎日本語 • ‎한국어

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

不要编辑DefaultSettings.php;将相应的行复制到LocalSettings.php 并进行所需的修改。

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配置设置

通用设置

Global Objects

Server URLs and file paths

Files and file 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

邮件设置

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

MySQL-specific

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

PostgreSQL-specific

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

SQLite-specific

Shared DB settings

Extension fields

  • $wgExtPGNewFields (在1.36版本中已移除) – Extension defined fields to be added to existing tables
  • $wgExtNewTables (在1.36版本中已移除)Extension Defined tables to be added on schema change
  • $wgExtNewFields (在1.36版本中已移除) – 定义添加到现有表格字段的扩展
  • $wgExtNewIndexes (在1.36版本中已移除)Extension defined indexes to be added to existing tables
  • $wgExtPGAlteredFields (在1.36版本中已移除)Extension defined columns to be altered in tables
  • $wgExtModifiedFields (在1.36版本中已移除) – Extension defined fields to change existing tables

Content handlers and storage

Performance hacks and limits

Cache

Main page: Manual:Caching
See: Interwiki for Interwiki cache settings.

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

HTTP proxy (CDN) settings

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

  • $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)
  • $wgCdnMaxAge (引入 自 1.34) – Cache TTL for the CDN sent as s-maxage (without ESI) or Surrogate-Control (with ESI).
  • $wgCdnReboundPurgeDelay – Secondary delayed purges of URLs
  • $wgCdnServersNoPurge (引入 自 1.34) – Same as $wgCdnServers , except that MW has no methods to send HTTP PURGE to an origin part of the configured ranges
  • $wgCdnServers (引入 自 1.34)An array of individual proxy servers to help MediaWiki detect if the request has been proxied.
    But also to send back to the proxy PURGE commands on changes.
  • $wgForcedRawSMaxage – Default maximum age (in seconds) for raw CSS/JavaScript accesses.
  • $wgInternalServer – Squid已知的内部服务器名称(如果不同于$wgServer )。
  • $wgLoggedOutMaxAge (引入 自 1.35) – 对于已登出用户,以最大寿命发送的用户代理缓存TTL。
  • $wgMaxSquidPurgeTitles (在1.27版本中已移除)Maximum number of titles to purge in any one client operation
  • $wgSquidMaxage (在1.35版本中已移除) – Cache timeout for the squid.
  • $wgSquidPurgeUseHostHeader (在1.33版本中已弃用) – Whether to use a Host header in purge requests sent to the proxy servers configured in $wgSquidServers.
  • $wgSquidServersNoPurge (在1.35版本中已移除)Same as $wgSquidServers , except that MW has no methods to send HTTP PURGE to an origin part of the configured ranges
  • $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.
  • $wgUseCdn (引入 自 1.34) – Enable/disable page view caching.
  • $wgUseESI (在1.33版本中已弃用) – If you run Squid3 with ESI support, enable this.
  • $wgUseKeyHeader (在1.34版本中已移除)Send the Key HTTP header for better caching.
  • $wgUsePrivateIPs – Whether private X-Forwarded-For IPs should be accepted
  • $wgUseSquid (在1.35版本中已移除) – 启用/禁用Squid。
  • $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

Language, regional and character encoding settings

Timezone settings

Language-specific

英语
  • $wgAmericanDates Use 'mdy' instead of 'dmy' as the default date format, e.g. 'May 12' instead of '12 May'.
阿拉伯语/印地语
  • $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.

Output format and skin settings

Output

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

Skins

  • $wgDefaultSkin – 新用户默认皮肤。
  • $wgFallbackSkin – Fallback skin used when the skin defined by $DefaultSkin can't be found.
  • $wgFooterIcons – Abstract list of footer icons for skins. It replaces the old copyrightico and poweredbyico code, which until MediaWiki 1.27 could be influenced with $CopyrightIcon
  • $wgSkinMetaTags (引入 自 1.36) – An array of open graph tags which should be added by all skins.
  • $wgSkipSkins – Specify the name of skins that should not be presented in the list of available skins.
  • $wgSkipSkin (在1.35版本中已移除) – Specify the name of a skin that should not be presented in the list of available skins.
  • $wgUseCombinedLoginLink Login / create account link behavior when it's possible for anonymous users to create an account.
  • $wgVectorUseIconWatch – 观看和取消观看为星形图标,而不是链接(仅适用于Vector皮肤界面)。
  • $wgVectorUseSimpleSearch – Vector皮肤下搜索表单的外观。

ResourceLoader

See ResourceLoader for more information.

Page titles and redirects

Namespaces

Mobile support

Interwiki links and sites

Interwiki cache

See interwiki cache for more information.

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.

  • $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版本中已移除) – 应该设置为整齐的二进制文件的路径。
  • $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 .

Statistics and content analysis

  • $wgActiveUserDays – 在一段时间中有编辑的用户将被视为活跃用户。
  • $wgArticleCountMethod – 方法用于确定内容名称空间中的页是否应算作有效的內容頁面(條目)。
  • $wgDisableCounters (在1.35版本中已移除) – 禁用页面预览次数计数器。
  • $wgExperiencedUserEdits Determines the number of edits needed to qualify at the "Experienced user" level.
  • $wgExperiencedUserMemberSince Determines the number of days needed since account creation to qualify at the "Experienced user" level.
  • $wgLearnerEdits Determines the number of edits needed to qualify at the "Learner" experience level.
  • $wgLearnerMemberSince Determines the number of days needed since account creation to qualify at the "Learner" experience level.
  • $wgManualRevertSearchRadius (引入 自 1.36)Maximum number of revisions of a page that will be checked against every new edit made to determine whether the edit was a manual revert.
  • $wgRevertedTagMaxDepth (引入 自 1.36) – Maximum depth (revision count) of reverts that will have their reverted edits marked with the mw-reverted change tag.
  • $wgSiteStatsAsyncFactor (在1.34版本中已移除) – Sets how often site statistics should be updated.

User accounts, authentication

Authentication

User rights, access control and monitoring

Access

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.

Security

Cookies

Profiling, testing and debugging

Debug

See also: 手册:如何调试

Profiling

搜索

Edit user interface

Maintenance Scripts setting

Recent changes, new pages, watchlist and history

See also Help:最近更改 and $wgDefaultUserOptions

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 e.g. Recentchanges, Newpages.
  • $wgOverrideSiteFeed – Override the site's default rss/atom feed that appears on every page.

Copyright

Import/Export

Extensions

Category

Logging

Special pages

Actions

  • $wgActions Array of allowed values for the "action" parameter for normal pages.

Robot policies

Ajax, Action API and REST API

Ajax

API

Shell and process control

HTTP client

Jobs

Site customization

Frontend

Miscellaneous settings

參見