扩展:扩展分配器

This page is a translated version of the page Extension:ExtensionDistributor and the translation is 55% complete.
MediaWiki扩展手册
ExtensionDistributor
发行状态: 稳定版
实现 特殊页面
描述 启用来自www.mediawiki.org的扩展分配
作者 Tim Starling, Sam Reed, Chad Horohoe
最新版本 持续更新
兼容性政策 快照跟随MediaWiki发布。 master分支不向后兼容。
MediaWiki 1.26+
数据库更改
许可协议 GNU通用公眾授權條款2.0或更新版本
下載
  • $wgExtDistDefaultSnapshot
  • $wgExtDistCandidateSnapshot
  • $wgExtDistPopularSkinList
  • $wgExtDistListFile
  • $wgExtDistAPIConfig
  • $wgExtDistSnapshotRefs
  • $wgExtDistGraphiteRenderApi
  • $wgExtDistPopularExtList
季度下載量 31 (Ranked 101st)
前往translatewiki.net翻譯ExtensionDistributor扩展
問題 开启的任务 · 报告错误

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以了解它如何工作。

安裝

  • 下载文件,并将解压后的ExtensionDistributor文件夹移动到extensions/目录中。
    开发者和代码贡献人员应从Git安装扩展,输入:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ExtensionDistributor
  • 将下列代码放置在您的LocalSettings.php 的底部:
    wfLoadExtension( 'ExtensionDistributor' );
    
  •   完成 – 在您的wiki上导航至Special:Version,以验证已成功安装扩展。

配置设置:

/**
 * 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' => \MediaWiki\Extension\ExtensionDistributor\Providers\GerritExtDistProvider::class,
	'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: https://github.com/wikimedia/labs-tools-extdist