手册:配置设置

From MediaWiki.org
Jump to: navigation, search
This page is a translated version of the page Manual:Configuration settings and the translation is 25% complete.

Other languages:
dansk • ‎Deutsch • ‎English • ‎español • ‎français • ‎Bahasa Indonesia • ‎日本語 • ‎한국어 • ‎polski • ‎português do Brasil • ‎русский • ‎中文

这是所有支持的配置设置索引,基于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.19 are no longer listed here. Please use the search box to find the relevant manual page (e.g. Manual:$wgAllowAnonymousMinor).
按字母排序列表 | 按功能排序列表 | Category:MediaWiki configuration settings

一般设置[edit]

路径[edit]

See also Uploads for file/image upload path settings.

参见皮肤一节获取皮肤路径设置。

全局对象[edit]

电子邮件设置[edit]

参见用户访问:$wgEmailConfirmToEdit

电子邮件通知(Enotif)设置[edit]

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

数据库设置[edit]

负载均衡设置[edit]

MSSQL相关[edit]

MySQL相关[edit]

Oracle相关[edit]

PostgreSQL相关[edit]

  • $wgDBmwschema - Schema that Postgres stores the MediaWiki tables in.

SQLite相关[edit]

共享数据库设置[edit]

压缩存储支持[edit]

  • $wgCompressRevisions - If this is set on, all future revisions will be compressed on page save, but only if zlib support is available and enabled in PHP.
  • $wgDisableOutputCompression - Disable output compression (compression is enabled by default if zlib is available).

本地化[edit]

时区设置[edit]

语言特定[edit]

英语
  • $wgAmericanDates - Enable for English module to print dates as eg 'May 12' instead of '12 May'.
阿拉伯语/印地语
  • $wgTranslateNumerals - For Hindi and Arabic use local numerals instead of Western style (0-9) numerals in interface.

调试/日志记录[edit]

参见:手册:如何调试

性能分析[edit]

  • $wgDebugFunctionEntry (在1.25版本中已移除) - Output debug message on every wfProfileIn/wfProfileOut
  • $wgDebugProfiling (在1.23版本中已移除) - Detects non-matching wfProfileIn/wfProfileOut calls
  • $wgProfiler -
  • $wgProfileCallTree (在1.27版本中已移除) - If true, print a raw call tree instead of per-function report
  • $wgProfileLimit (在1.25版本中已弃用) - Only record profiling info for pages that took longer than this
  • $wgProfileOnly (在1.23版本中已弃用) - Don't put non-profiling info into log file
  • $wgProfilePerHost (在1.27版本中已移除) - Should application server host be put into profiling table?
  • $wgProfileToDatabase (在1.23版本中已移除) - Log sums from profiling into profiling table in db.
  • $wgUDPProfilerHost (在1.27版本中已移除) - UDP分析器的主机。
  • $wgUDPProfilerPort (在1.27版本中已移除) - UDP分析器的端口。


网站个性化[edit]

Ajax[edit]

前端[edit]

资源加载器[edit]

See ResourceLoader for more information.

名字空间[edit]

输出[edit]

The following settings are only used if $wgHtml5 is set to "false" (在1.22版本中已移除):

  • $wgDocType (在1.22版本中已移除) - The doc type to use in the <!DOCTYPE !> declaration.
  • $wgDTD (在1.22版本中已移除) - Specifies the DTD in the DOCTYPE declaration for page output.
  • $wgXhtmlDefaultNamespace (在1.22版本中已移除) - 默认XHTML名字空间

机器人方针[edit]

移动支持[edit]

网站统计[edit]

皮肤[edit]

分类[edit]

缓存[edit]

参见:跨wiki一栏获取跨wiki缓存设置。

客户端缓存[edit]

文件缓存[edit]

Settings for Server side file caching.

  • $wgFileCacheDepth - Depth of the subdirectory hierarchy to be created under $wgFileCacheDirectory.
  • $wgFileCacheDirectory - Directory where the cached page will be saved when using server-side caching.
  • $wgUseFileCache - This will cache static pages for non-logged-in users to reduce database traffic on public sites.

消息缓存[edit]

边栏缓存[edit]

解析器缓存[edit]

  • $wgEnableParserCache (在1.26版本中已弃用) - Keep parsed pages in a cache (objectcache table, turck, or memcached) to speed up output of the same page viewed by another user with the same options.
  • $wgRenderHashAppend - Append a configured value to the parser cache and the sitenotice cache keys.
  • $wgParserCacheExpireTime - Expiration time (in seconds) of cached parser information
  • $wgParserCacheType - 解析器缓存设置。

高速缓存设置[edit]

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


跨wiki[edit]

跨wiki缓存[edit]

参见跨wiki缓存获取更多信息。

访问[edit]

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

See Manual:Preventing access for more methods and settings concerning access. See also Manual:User rights</> for more information about $wgGroupPermissions, $wgAddGroups, $wgRemoveGroups, etc.

See User Access for User Access settings.

速率控制[edit]

API[edit]


Wiki锁定[edit]

  • $wgReadOnly - Disallows editing, displaying the string given as the reason.
  • $wgReadOnlyFile - If this file is found, the database is locked for the reason given in the contents of the file.


减少[edit]

上传[edit]

Uploads have to be specially set up to be secure.

共享上传[edit]

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

MIME类型[edit]

警告 警告: This is not a configuration setting, but a global state variable. It should be used solely by thumb.php!
  • $wgVerifyMimeType - Determines if the mime type of uploaded files should be checked
  • $wgMimeTypeBlacklist - Files with these mime types will never be allowed as uploads if $wgVerifyMimeType is enabled.
  • $wgXMLMimeTypes - An array of XML mime types we can detect via MimeMagic.

See also: Manual:Mime type detection

图片[edit]

See also: Manual:Configuring file uploads

DjVu[edit]

EXIF[edit]

  • $wgShowEXIF - Determines whether EXIF metadata is to be displayed. Set to false for not showing data.
  • $wgUpdateCompatibleMetadata - Whether to automatically update the img_metadata field if the metadata field is outdated but compatible with the current version.

ImageMagick[edit]

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

SVG[edit]

缩略图设置[edit]

防病毒[edit]

解析器[edit]

HTML[edit]

  • $wgRawHtml - Allow raw, unchecked HTML in <html>...</html> sections.

Tidy[edit]

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.
  • $wgAlwaysUseTidy (在1.26版本中已弃用)
  • $wgDebugTidy - Put tidy warnings in HTML comments, only works for internal tidy.
  • $wgTidyBin (在1.26版本中已弃用) - Should be set to the path of the tidy binary.
  • $wgTidyConf (在1.26版本中已弃用) - Should be set to the path of the tidy configuration file.
  • $wgTidyInternal (在1.20版本中已弃用)- Controls the use of the PECL extension to use an inprocess tidy library instead of spawning a separate program.
  • $wgTidyOpts (在1.26版本中已弃用) - Options passed to tidy on the command line.
  • $wgUseTidy (在1.26版本中已弃用) - Use tidy to make sure HTML output is sane.
  • $wgValidateAllHtml - Validate the overall output using tidy and refuse to display the page if it's not valid.
See also: Manual:Build Tidy from source.

特殊页面[edit]

最近更改[edit]

See also Help:Recent changes and $wgDefaultUserOptions

UDP更新[edit]

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


用户[edit]

验证[edit]

用户访问[edit]

用户代理[edit]

Cookies[edit]

订阅源[edit]

  • $wgFeed - Toggle syndication feeds on and off.
  • $wgAdvertisedFeedTypes - Which feed types 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.

版权[edit]

搜索[edit]

作业[edit]

代理[edit]

Squid[edit]

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

  • $wgInternalServer - Internal server name as known to Squid, if different.
  • $wgMaxSquidPurgeTitles (在1.27版本中已移除) - Maximum number of titles to purge in any one client operation
  • $wgSquidPurgeUseHostHeader - Whether to use a Host header in purge requests sent to the proxy servers configured in $wgSquidServers.
  • $wgSquidMaxage - HTTP代理的缓存超时。
  • $wgSquidServers - A list of proxy servers (ips if possible) to purge on changes.
  • $wgSquidServersNoPurge - Same as $wgSquidServers, except they aren't purged.
  • $wgUseESI - 如果您运行具有ESI支持的Squid3,启用它。
  • $wgUseSquid - 为缓存的HTTP代理启用/禁用支持。
  • $wgUseXVO (在1.27版本中已移除) - Send X-Vary-Options header for better caching (requires patched Squid).
  • $wgVaryOnXFP - Whether to add X-Forwarded-Proto to the Vary and X-Vary-Options headers for API requests and RSS/Atom feeds.

HTCP组播刷新[edit]

扩展[edit]

维护脚本设置[edit]

杂项设置[edit]

See also[edit]