Tiện ích mở rộng:WikimediaIncubator

This page is a translated version of the page Extension:WikimediaIncubator and the translation is 100% complete.
Cẩm nang phần mở rộng MediaWiki
OOjs UI icon advanced-invert.svg
Trạng thái phát hành: ổn định
Cài đặt Special page , Variable
Mô tả Thêm các chức năng dành cho Wikimedia Incubator
Tác giả SPQRobin, Hydriz, Jon Harald Søby
Phiên bản 6.2.0 (Cập nhật liên tục)
MediaWiki >= 1.38
Giấy phép GNU General Public License 2.0 or later
Tải xuống
Ví dụ Wikimedia Incubator
  • $wgLangCodeLength
  • $wgProjectSite
  • $wgProjects
  • $wgExistingWikis
  • $wgMultilingualProjects
  • $wgPseudoCategoryNSes
  • $wgClosedWikis
  • $wgPref
  • $wgTestWikiNamespaces
Quarterly downloads 2 (Ranked 164th)
Translate the WikimediaIncubator extension if it is available at translatewiki.net
Issues Open tasks · Báo cáo lỗi

Tiện ích mở rộng này bổ sung một hệ thống wiki thử nghiệm được thiết kế ban đầu cho Wikimedia Incubator. Nó cũng có thể được điều chỉnh để sử dụng cho ảo hóa wiki, tức là wiki bên trong wiki thực. Mỗi wiki ảo (hay còn gọi là wiki thử nghiệm) được liên kết với một dự án (ví dụ: Wikipedia) và một ngôn ngữ, tạo thành tiền tố cho một trang (Wx/xyz).

A brief overview of the features:

  • A preference where you can enter the test wiki you are working on
  • A special page "Special:ViewUserLang" to view the language and test wiki preference of a user
  • Special:RecentChanges displays edits on the user's wiki test
  • A magic word {{USERTESTWIKI}} that returns the user's test wiki (prefix)
  • For pages in test wiki namespaces
    • check if the page is not prefixed — page creation is disallowed (unless the user submitted "Incubator" as preference) and an error message is shown (with suggestion for a prefixed title if possible)
    • check if the wiki exists — page editing/creation is disallowed and a message is shown
  • A user group "test-sysop" with limited admin rights
  • Special:MyWiki going to the main page of your test wiki (or the default Main Page if your preference is set to None or Incubator).
  • Special:RandomByTest going to a random page in a test wiki
  • Special:ListUsers can be filtered by test wiki
  • Search in test wiki (if supported by search engine)
  • Special:IncubatorFirstSteps
  • Special:SearchWiki to automatically redirect to a wiki whether or not it exists or is a test wiki in the Incubator
  • Prefixes are disregarded when sorting in categories.

Cài đặt

  • Download and place the file(s) in a directory called WikimediaIncubator in your extensions/ folder.
  • Thêm mã sau vào dưới cùng tệp $LocalSettings của bạn:
    wfLoadExtension( 'WikimediaIncubator' );
    It is recommended to install the CLDR extension as well.
  •   Xong – Chuyển tới Special:Version trên wiki của bạn để xác nhận phần mở rộng được cài đặt thành công.

Cấu hình

The extension is configured by default for the Wikimedia Incubator. With some configuration changes, it may also work for other wikis using a "virtual wiki" system. These are general configuration settings; specific settings can be found in the section "Features".

The project codes and some metadata about each one:

  • name is the name of the project (used in preferences amongst other things)
  • dbsuffix is the suffix that is appended to the language code to form the DBname of the project (in Wikimedia this is wiki for Wikipedia and the project name for other projects)
  • wikitag is the tag that applies to the project (part of SiteConfiguration as used by $wgConf)
  • sister, which is a boolean indicating whether or not that project's test wikis are hosted elsewhere (true if they are hosted elsewhere, false if they are hosted on the Incubator)

The project code should be a single letter; the extension might break if you use more than one letter for the code.

$wmincProjects = [
	'p' => [
		'name' => 'Wikipedia',
		'dbsuffix' => 'wiki',
		'wikitag' => 'wikipedia',
		'sister' => false,
	't' => [
		'name' => 'Wiktionary',
		'dbsuffix' => 'wiktionary',
		'wikitag' => 'wiktionary',
		'sister' => false,
	'b' => [
		'name' => 'Wikibooks',
		'dbsuffix' => 'wikibooks',
		'wikitag' => 'wikibooks',
		'sister' => false,
	'q' => [
		'name' => 'Wikiquote',
		'dbsuffix' => 'wikiquote',
		'wikitag' => 'wikiquote',
		'sister' => false,
	'n' => [
		'name' => 'Wikinews',
		'dbsuffix' => 'wikinews',
		'wikitag' => 'wikinews',
		'sister' => false,
	'y' => [
		'name' => 'Wikivoyage',
		'dbsuffix' => 'wikivoyage',
		'wikitag' => 'wikivoyage',
		'sister' => false,
	's' => [
		'name' => 'Wikisource',
		'dbsuffix' => 'wikisource',
		'wikitag' => 'wikisource',
		'sister' => true,
	'v' => [
		'name' => 'Wikiversity',
		'dbsuffix' => 'wikiversity',
		'wikitag' => 'wikiversity',
		'sister' => true,

The name and key used by the preference for administrators who do maintenance work and are not working on a test wiki.

$wmincProjectSite = [
	'name' => 'Incubator',
	'short' => 'inc',

The maximum length of a language code. Pretty useless actually.

$wmincLangCodeLength = 12;

An array of database names for which there is an existing subdomain, i.e. no test wiki. Defaults to $wgLocalDatabases .

$wmincExistingWikis = $wgLocalDatabases;

An array or file name containing all closed wikis. It is assumed that wikis in this list are also in $wgExistingWikis. Defaults to $wgSiteMatrixClosedSites.

$wmincClosedWikis = isset( $wgSiteMatrixClosedSites ) ? $wgSiteMatrixClosedSites : null;

Tính năng

Tuỳ chọn


On Special:Preferences, beneath the language selector, you can select the test wiki you are working on. You can select the project (Wikipedia, Wikibooks, ...) and the language code. It defaults to "None/All". Another option, "Maintenance" is intended for users, mostly administrators, who do maintenance and are not working on a test wiki.

A magic word "{{USERTESTWIKI}}" which displays the prefix depending on the value you selected. Using &testwiki=wx/xyz in the URL should alter this value in principle, but this is not reflected on the page due to the cache. In general, &testwiki=wx/xyz works in a similar way as &uselang=xx, respectively for the test wiki and language preference.

The name of the preference (not really important, shouldn't be changed):

$wmincPref = 'incubatortestwiki';

Trang đặc biệt


A special pages, Special:ViewUserLang is added where users with the 'viewuserlang' right, can view the interface language and selected test wiki of a user. This can be useful information when a user has a problem with the test wiki system.

The default configuration:

$wgGroupPermissions['*']['viewuserlang'] = false;
$wgGroupPermissions['sysop']['viewuserlang'] = true;

Special:MyWiki redirects you to the Main Page of the test wiki that you selected, i.e. "Wx/xyz?goto=mainpage" (see section "Info pages"), or to a given page on that wiki if you use subpage syntax ("Special:MyWiki/Pagename"). If no preference selected or "Incubator" is selected, you are redirected to the regular Main Page.

Special:RandomByTest redirects you to a random page in your test wiki. If &testwiki=wx/xyz is specified in the URL, it will redirect you to a random page in that test wiki. If your preference is set to "Incubator" it behaves like Special:Random below version 1.18; or goes to a random help or project page in 1.18 and above.

Special:SearchWiki allows to find an existing wiki as well as test wikis. You can select the project you are looking for, and the language name or language code. It will redirect automatically if the wiki is found. The special page can be transcluded on normal pages.

Special:IncubatorFirstSteps guides the user through setting up their account, their test wiki preference and starting a test wiki.

Recent changes

Thay đổi gần đây

The recent changes special page is adapted to display the edits in the test wiki of your preference. "None/All" returns the normal display, and "Incubator" displays all edits that are not made in a test wiki. You can select the project and enter a language code to view the recent changes of a specific test wiki, or you can use &testwiki=wx/xyz in the URL.

Trang thông tin

On root "Wx/xyz" pages, a placeholder is shown if that page does not exist (following redlinks redirects you to viewing the page instead of editing it). For non-existing wikis, it shows a welcome page and invites the user to start a test wiki in this language and project. There are also links to sister projects and multilingual projects, according to the configuration.

The project URLs and names of multilingual projects, i.e. related projects for which there are no translated versions and thus no test wikis.

$wmincMultilingualProjects = [
	'meta.wikimedia.org' => 'Meta-Wiki',
	'commons.wikimedia.org' => 'Wikimedia Commons',
	'species.wikimedia.org' => 'Wikispecies',
	'mediawiki.org' => 'MediaWiki',

If the URL includes &goto=mainpage, it redirects to to the existing subdomain in case that exists; otherwise it redirects you to a subpage "Wx/xyz/Main Page" where "Main Page" is translated depending on the MediaWiki localisation of the language of that test wiki.

Pages in test wiki namespaces

Namespaces used for test wikis (e.g. "Wx/xyz/Page" and "Template:Wx/xyz/Page" are allowed, but not "Help:Wx/xyz/Page").

$wmincTestWikiNamespaces = array(

Pseudo-category namespaces, e.g. "Category:Maintenance:Delete". Creating unprefixed pages in category namespaces is restricted by default, but for some categories related to the site itself, it is useful to allow creating subcategories. It only allows colons (:) as delimiter. (See incubator:Category:Users:By_language as an example.)

$wmincPseudoCategoryNSes = array( 'Incubator', 'Help', 'Users', 'Maintenance', 'Files' );

Pages belonging to test wikis that have an existing subdomain, cannot be edited nor created and display a message linking to the existing wiki. If your test wiki preference is set to that test wiki, or if &testwiki=wx/xyz equals to that test wiki, you are redirected to the wiki.

Pages in test wiki namespaces, that lack a prefix, cannot be created (but existing unprefixed pages can be edited). It shows an error message, and if you have set a test wiki preference, it suggests to create a correctly prefixed page.

Pages in test wiki namespaces are marked as being written in the language depending on the "xyz" language code. This means for example that pages of "Wx/ar" (Arabic) and "Wx/he" (Hebrew) are from right-to-left.

Test admins

Configuration is set by default to create a user group of "test administrators", who have limited administrator rights like delete, undelete, view deleted history, block, block email and rollback. There is no technical restriction (yet) that a test admin can only perform actions within their test wiki.

The default configuration for the test administrator user group.

$wgGroupPermissions['test-sysop']['delete'] = true;
$wgGroupPermissions['test-sysop']['undelete'] = true;
$wgGroupPermissions['test-sysop']['deletedhistory'] = true;
$wgGroupPermissions['test-sysop']['autopatrol'] = true;
$wgGroupPermissions['test-sysop']['block'] = true;
$wgGroupPermissions['test-sysop']['blockemail'] = true;
$wgGroupPermissions['test-sysop']['rollback'] = true;
$wgGroupPermissions['test-sysop']['suppressredirect'] = true;
$wgAddGroups['bureaucrat']['test-sysop'] = true;
$wgRemoveGroups['bureaucrat']['test-sysop'] = true;


Special:ListUsers can be filtered by test wiki. You can input a test wiki prefix ("Wx/xyz") or "Incubator" and it will filter the list of users to those who have set their test wiki preference to that.


You can search in a test wiki if the search engine supports it (which is true on WMF wikis). It will do so by default in your test wiki, but you can change it by using the input form that is shown in the advanced search form.

Also, a custom message will be shown, either "Set your test wiki preference so we can tell you which page to create!" or "You can create Wx/xyz/Search_term!".

Liên kết