Extension:WikimediaIncubator

This extension adds a test wiki system originally designed for the Wikimedia Incubator. It can also be adapted to be used for wiki virtualization, i.e. wikis inside the real wiki. Each virtual wiki (aka test wiki) is linked to a project (e.g. Wikipedia) and a language, which form the prefix for a page (Wx/xxx).

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 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:MyMainPage 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

Installation
To install this extension, add the following line to LocalSettings.php:

Configuration
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 with their names. The extension might break if you use more than one letter for the code.

The project codes and names of sister projects, i.e. related projects for which the test wikis are hosted somewhere else. Idem: the extension might break if you use more than one letter for the code.

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

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

An array containing the database suffixes per project (the key should match the ones of $wmincProjects). The language codes are put in front of these names, e.g. "eswikibooks" or "xmfwiki").

An array of database names for which there is an existing subdomain, i.e. no test wiki. Defaults to $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.

Preferences
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, "Incubator" is intended for users, mostly administrators, who do maintenance and are not working on a test wiki.

A magic word " " which displays the prefix depending on the value you selected. Using &testwiki=wx/xx in the URL should alter this value in principle, but this is not reflected on the page due to the cache.

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

Special pages
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:

Special:MyMainPage redirects you to the Main Page of the test wiki that you selected, i.e. "Wx/xx?goto=mainpage" (see section "Info pages"). 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/xx 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.



Recent changes
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/xx in the URL.

Info pages
On root "Wx/xx" 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.

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/xx/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/xx/Page" and "Template:Wx/xx/Page" are allowed, but not "Help:Wx/xx/Page").

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.)

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/xx 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.

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 his/her test wiki.

The default configuration for the test administrator user group.

Links

 * See SVN for source code.
 * See this wiki for to-do's & development.
 * Wikimedia Incubator