Open main menu
This page is a translated version of the page Extension:ExtensionDistributor and the translation is 45% complete.

Other languages:
Deutsch • ‎English • ‎español • ‎中文 • ‎日本語
MediaWiki扩展手册
OOjs UI icon advanced.svg
ExtensionDistributor
发布状态: 稳定版
实现 特殊页面
描述 启用来自www.mediawiki.org的扩展分配
作者 Tim Starling, Sam Reed, Chad Horohoe
最新版本 持续更新
MediaWiki 1.26+
数据庫更新
许可协议 GNU通用公眾授權條款2.0 or later
下载
  • $ExtDistAPIConfig
  • $ExtDistListFile
  • $ExtDistSnapshotRefs
  • $ExtDistDefaultSnapshot
  • $ExtDistCandidateSnapshot
  • $ExtDistGraphiteRanderApi
  • $ExtDistPopularExtList
  • $ExtDistPopularSkinList
翻译ExtensionDistributor扩展如果在translatewiki.net可用
检查使用和版本矩阵。
问题 开放的工作 · 报告错误

The ExtensionDistributor extension generates .tar.gz snapshots of extensions in the git repository and distributes them. It is intended for use on www.mediawiki.org. 参见Special:ExtensionDistributor以了解它如何工作。

安装

  • 下载文件,并将其放置在您extensions/文件夹中的ExtensionDistributor目录内。
  • 将下列代码放置在您的LocalSettings.php的底部:
    wfLoadExtension( 'ExtensionDistributor' );
    
  •   完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。

Configuration settings:

/**
 * Configuration for the API client to use
 *
 * Must have a 'class' key, can either be
 * "GithubExtDistProvider" or "GerritExtDistProvider"
 *
 * Common parameters:
 *  'apiUrl' - API url to use with $EXT and $REF variables
 *  'tarballUrl' - API url where tarballs are located
 *  'tarballName' - Expected filename of tarballs
 *  'proxy' - Proxy to use (optional)
 *
 * Github specific parameters:
 *  'token' - An OAuth token for authenticating requests
 *
 * Gerrit specific parameters:
 *  'repoListUrl' - API url to fetch a list of repositories
 *
 * @var array
 */
$wgExtDistAPIConfig = false;

/**
 * File to fetch list of extensions from, with one extension per line
 * Only needed for the Github provider
 * Example url: https://gerrit.wikimedia.org/mediawiki-extensions.txt
 */
$wgExtDistListFile = false;

/**
 * Supported branches/tags, master is the default (and shouldn't be removed)
 */
$wgExtDistSnapshotRefs = array(
	'master',
);

/**
 * Snapshot branch/tag to default to
 */
$wgExtDistDefaultSnapshot = 'master';

You'll need to set up some configuration for the extension to work. For Wikimedia's Gerrit instance, it would look like:

$wgExtDistAPIConfig = array(
	'class' => 'GerritExtDistProvider',
	'apiUrl' => 'https://gerrit.wikimedia.org/r/projects/mediawiki%2F$TYPE%2F$EXT/branches',
	'tarballUrl' => 'https://extdist.wmflabs.org/dist/$TYPE/$EXT-$REF-$SHA.tar.gz',
	'tarballName' => '$EXT-$REF-$SHA.tar.gz',
	'repoListUrl' => 'https://gerrit.wikimedia.org/r/projects/?p=mediawiki/$TYPE/',
);

$wgExtDistSnapshotRefs = array(
	'master',
	'REL1_25',
);

The Gerrit provider requires an independent tarball generator, the source code for the one running at extdist.wmflabs.org can be found here.