Manual:Extensions/zh

From MediaWiki.org
Jump to: navigation, search
Gnome-preferences-other.svg Extensions: Tag Extensions Parser Functions Hooks Special Pages Skins Magic Words

[edit] 什么是扩展插件?

MediaWiki extensions

扩展插件允许你定制MediaWiki的外观和工作方式。

Wiki用户可以浏览现有扩展插件或者请求一个新插件. 系统管理员可在他管理的MediaWiki网站上安装(或删除)扩展插件。开发者可以编写新插件 或者 完善已有插件

根据关键字搜索扩展插件:

Contents


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

[edit] 浏览扩展插件

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

[edit] 检查已安装的插件

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

`==安装扩展插件== 在安装完MediaWiki后即可安装扩展插件。添加一个插件需要下面几个步骤:

  1. 开始前
    少数扩展插件需要安装补丁. 其中大多数提供了专为unix安装命令而设计的使用说明.这需要命令行权限(SSH)来运行这些在扩展插件帮助页面上给出的命令'
  2. 下载扩展插件.
    Extension Distributor 可帮你选择和下载最受欢迎的扩展插件.
    扩展插件通常以模块的程序包形式发布. They generally go in their own subdirectory of $IP/extensions/. 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).
  3. 安装扩展插件.
    通常, 在LocalSettings.php文件的结尾(但应在PHP代码结束符"?>"之前)添加下列代码:
    require_once( "$IP/extensions/extension_name/extension_name.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.
    Note: Ensure that required permissions are set for extensions!
    Note: While this installation procedure is sufficient for most extensions, some require a different installation procedure. Check your extension's documentation for details.
    Note: If you want to alter configuration variables in LocalSettings.php, you have to do this typically after including the extension. Otherwise defaults defined in the extension will overwrite your settings.
    Caution! Caution: While extension declaration can be placed in other places within the LocalSettings.php file, never place extensions before the require_once( "includes/DefaultSettings.php" ); line. Doing so will blank the extension setup function arrays, causing no extensions to be installed, and probably will make your wiki inaccessible until you fix it!

[edit] 完善扩展插件

FIXME

[edit] 开发扩展插件

This complex topic is handled on under the developing extensions manual page.

[edit] 另请参阅

Extensions: CategoryAllRequestsTag extensionsExtension MatrixExtensions FAQExtension hook registryExtension namespace registry
Language: English  • Deutsch • Ελληνικά • Français • Bahasa Indonesia • 日本語 • 한국어 • Polski • Русский • 中文
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox