Extension:WikiFarm

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
WikiFarm

Release status:Extension status unmaintained

ImplementationTemplate:Extension#type Special page
DescriptionTemplate:Extension#description Assists in wiki farm management
Author(s)Template:Extension#username Pavel Malakhov (24pmtalk)
Latest versionTemplate:Extension#version 2.3 (2012.10.24)
MediaWikiTemplate:Extension#mediawiki 1.16 -1.20
LicenseTemplate:Extension#license Public Domain/GNU GPL
Download download
home page
ExampleTemplate:Extension#example single wiki (Russian)
2 wiki farms (English)

Translate the WikiFarm extension if it is available at translatewiki.net

Check usage and version matrix.

The WikiFarm extension is a tool designed to assist wiki farm administrators in maintaining their wiki, multiple individual wikis or wiki farm(s).

About[edit]

The current version has 7 modules:

  • WikiFarmStatistics - shows the following information for each wiki:
    • wiki name (What API returns)
    • number of pages
    • number of articles
    • number of views
    • number of edits
    • number of files
    • number of users
    • number of categories
    • number of templates
    • interwiki prefix, if exists in interwiki table

The following is visible in debug info level only:

  • wiki URL and API URL
  • list of wikis for each DB
  • table prefix in DB
  • DB name
  • DB server


  • WikiFarmLinks - gathers usefull administrative links for every wiki.
  • WikiFarmChanges - shows recent changes from all wikis.
  • WikiFarmPages - shows all articles in the project from all wikis.
  • WikiFarmUsers - list all users of administrative wiki with useful links for each of them. So it is good to have an admin wiki as one of wiki farm.
  • WikiFarmLog - provides links to log pages. Bots can write to the log, which is useful to trace their work. The log is a page(s) in the "project" namespace.
  • WikiFarmSearch - search for string in titles and text in all wikis.
  • + You can find special scripts for batch-renaming MySQL tables in tools directory.
  • More features are being developed for future releases of this extension. I am morally ready to use git if anyone is interested in that.


  • WikiFarm requires one wiki to be an "admin wiki". The admin wiki can be a central or a master wiki, but it could also just be a regular wiki. WikiFarm uses the admin wiki to:
    • read the user database
    • read the interwiki table (optional)
    • write log pages (optional)


  • Since version 2.0, WikiFarm is using the MediaWiki API, which required a complete code rewrite.
  • Since v2.2 direct MySQL requests are used just to scan DB for wikis (optional).

See home page for previous versions and release notes.


  • Note: this extension does not set up wiki farms automatically. It helps to manage an existing wiki or wiki farm(s).

Screenshots[edit]

WikiFarmStatistics WikiFarmLinks WikiFarmChanges WikiFarmPages WikiFarmUsers WikiFarmSearch

Prerequisite[edit]

  • cURL module for php5 - standard on most web servers, so in most cases you have this already.


Installation[edit]

  • Download and place the file(s) in a directory called WikiFarm in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/WikiFarm/WikiFarm.php";
    
  • Optionally disable WikiFarm tools at the end of /extensions/WikiFarm/WikiFarm.php
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

One wiki installation[edit]

Set variables in /extensions/WikiFarm/WikiFarm_config.php

  • Set prefix delimiter for MySQL wiki tables. If there is none set it to ''.
$wfarmPrefixDelimiter = '__';


  • Set admin wiki. In this case it is your wiki.
$wikiAdmin = new wfarmWikiInstance(
	'http://wiki.domain.name/main',   	// URL to wiki page
	'http://wiki.domain.name/w-main/api.php',   // MediaWiki API end point for admin wiki.
	$wfarmDBConnection[0],     		// db connection, see above
	'main__',	               		// prefix for tables (interwiki, users). It may be $wgSharedPrefix
	'',					// Bot name. Leave it empty to anonymous queries
	''					// Bot pass
);
  • Comment additional wikis description
/*
$wikis[] = new wfarmWikiInstance(
	'http://wiki.domain.name',      // url to wiki page
	'http://wiki.domain.name',      // MediaWiki API end point. If prefix is [all], leave it the same as URL.
	$wfarmDBConnection[0], 		// db connection, see above
	'[all]',	           	// table prefix. Set it to "[all]" to get all wikis in the database. DB will be scanned for wikis in it
	'',				// Bot name. Leave it empty to annonimous queries
	''				// Bot pass
);
*/

Several wikis installation[edit]

Set variables in /extensions/WikiFarm/WikiFarm_config.php

  • Set prefix delimiter for MySQL wiki tables. If there is none set it to ''.
  • Set admin wiki. It will be looked up for interwiki links and users.
  • Set admin wiki. In this case it is your wiki.
$wikiAdmin = new wfarmWikiInstance(
	'http://wiki.domain.name/main',   	// URL to wiki page
	'http://wiki.domain.name/w-main/api.php',   // MediaWiki API end point for admin wiki.
	$wfarmDBConnection[0],     		// db connection, see above
	'main__',	               		// prefix for tables (interwiki, users). It may be $wgSharedPrefix
	'',					// Bot name. Leave it empty to anonymous queries
	''					// Bot pass
);
  • Uncomment and set variables $wfarmDBConnection[] and $wikis[], see config file for info.

Usage[edit]

To use this extension, go to the Special:WikiFarm page on your wiki.

Issues[edit]

  • In MediaWiki version 1.23.3 (may be from v.1.21?) Special:SpecialPages returns blank page if use WikiFarm with the following error in log file:
Fatal error: Call to undefined function wfLoadExtensionMessages() in …/extensions/WikiFarm/WikiFarm_body.php on line 7

The solution is to comment this 7th line in WikiFarm_body.php

  • WikiFarmChanges:
    • Hide my edits -- to be implemented soon
    • Show changes since -- this feature isn't useful to me, so it's a low priority
  • Please send me a note if you have other issues.

Examples[edit]

See also[edit]