Manual:Extensions/zh

{| {| style="border: 2px solid #aaa; padding: 1em 2em; margin: 1em 0 2em 0; width:auto; margin:0 auto; float: left" |

什么是扩展插件?
扩展插件允许你定制MediaWiki的外观和工作方式. Wiki用户可以浏览现有扩展插件或者请求一个新插件. 系统管理员可在他管理的MediaWiki网站上安装（或删除）扩展插件. 开发者可以编写新插件或者完善已有插件. 根据关键字搜索扩展插件：
 * style="text-align: center; valign: middle; padding: 0 2em" |
 * }
 * style="white-space: nowrap;" |


 * }

安装插件可以实现各人不同的目的：


 * 扩充用于写文章的wiki的标记 - 参阅 Category:Parser function extensions 和 Category:Parser extensions.
 * 添加新的报告或新的管理功能 - 参阅 Category:Special page extensions.
 * 改变MediaWiki的外观和感觉 - 参阅 Gallery of user styles 和 Category:User interface extensions.
 * 定制验证机制提高安全等级 - 参阅 Category:Authentication and Authorization Extensions.

浏览扩展插件
你可浏览Category:Extensions by category（扩展插件的分类）或者Extension Matrix（扩展插件矩阵）以了解已有插件的功能范围. 关于如何安装这些插件或者如何编写自己的插件，参见后续章节.

检查已安装的插件
只有那些具备访问服务器文件系统的管理员可以安装用于MediaWiki的扩展插件，但是任何人都可以点击Special:Version页面获得当前有哪些扩展插件被用在这个MediaWiki网站上的信息. 例如，点击这里可以了解哪些扩展插件被用在了英文维基百科.

安装扩展插件
在安装完MediaWiki后即可安装扩展插件. 添加一个插件需要下面几个步骤：


 * 1) 开始前
 * 少数扩展插件需要安装补丁. 其中大多数提供了专为unix安装命令而设计的使用说明. 这需要命令行权限（SSH）来运行这些在扩展插件帮助页面上给出的命令.
 * 1) 下载扩展插件.
 * Extension Distributor 可帮你选择和下载最受欢迎的扩展插件.
 * 扩展插件通常以模块的程序包形式发布. They generally go in their own subdirectory of .  A list of extensions documented on MediaWiki.org is available on the extension matrix, and a list of extensions stored in the Wikimedia SVN repository is located at svn:trunk/extensions. Some extensions are available as source code within [ this wiki] . You may want to automate copying them.
 * Unofficial bundles of the extensions in the Wikimedia SVN repository can be found on the toolserver. These bundles are arbitrary snapshots, so keep in mind they might contain a broken version of the extension (just as if you load them from the developer's repository directly).
 * 1) 安装扩展插件.
 * 通常, 在 文件的结尾（但应在PHP代码结束符" "之前）添加下列代码：
 * This line forces the PHP interpreter to read the extension file, and thereby make it accessible to MediaWiki.
 * Some extensions can conflict with maintenance scripts, for example if they directly access $_SERVER (not recommended).
 * In this case they can be wrapped in the conditional so maintenance scripts can still run.
 * if (!$wgCommandLineMode) {
 * require_once( "$IP/extensions/extension_name/extension_name.php" );
 * }
 * The maintenance script importDump.php will fail for any extension which requires customized namespaces which is included inside the conditional above such as Extension:Semantic MediaWiki, Extension:Semantic Forms.
 * The maintenance script importDump.php will fail for any extension which requires customized namespaces which is included inside the conditional above such as Extension:Semantic MediaWiki, Extension:Semantic Forms.

完善扩展插件
FIXME

This complex topic is handled on under the developing extensions manual page.
 * 1) REDIRECT==开发扩展插件==

另请参阅

 * Extension Matrix
 * Category:Extensions
 * Category:Extensions in need of a new maintainer
 * Template:Extension
 * Manual:Developing extensions
 * Manual:Parser functions
 * Manual:Special pages
 * Manual:Tag extensions
 * Project:Extension requests
 * Manual:Translating extensions - Information about translating extensions.
 * m:Category:MediaWiki extensions - in the process of being moved to MediaWiki.org.