Technical Details


Jump to: navigation, search

These are the technical details of the UNDP ECIS WaterWiki install. It is a heavily customized version of MediaWiki, the software the runs Wikipedia. The modifications aim to simplify the interface and use of the Wiki, and remove functions not necessary for this install. DO NOT UPDATE OR MODIFY the wiki software unless you are aware of everything here.



Started with the current, stable release of MediaWiki: version 1.4.7. Download here

The Installation Guide
The MediaWiki Handbook(your friend!)

Make sure that mysql support was included in php. If mysql calls fail during Installation, contact the server admin, ask them to edit php.ini

Encountered an error while the database tables were being created.

installation may fail when creating table 'categorylinks'
"Specified key was too long; max key length is 1000 bytes"

Turns out this is a problem in mySQL 4.1, described here One solution is to change default charset. Another solution, employed on this wiki, is to modify the query in $ROOT/maintenance/tables.sql, as discussed here.

CREATE TABLE wiki_categorylinks ( cl_from int(8) unsigned NOT NULL default '0', cl_to varchar(200) binary NOT NULL default '', cl_sortkey varchar(255) binary NOT NULL default '', cl_timestamp timestamp NOT NULL, UNIQUE KEY cl_from(cl_from,cl_to), KEY cl_sortkey(cl_to,cl_sortkey(128)), KEY cl_timestamp(cl_to,cl_timestamp) )

To proceed after the error, all tables were DELETE-d from the database, and the configuration page was reloaded and started fresh.

Summary of Major Modifications

The interface was greatly simplified, many unnecessary links/instructions/warnings removed.

New pages prompt users to create content from predefined templates. These templates have preset categories and sections, which get used for section transclusion and DynamicPageLists elsewhere (such as Lessons Learned).

Particularly, the extensions <Project> and <Report> use transclusion from pages created with the associated template.

The Magic Word __TABLESEC__ sets up columned formatting of sections, and is used in the templates.

Logins are handled by the UNDP LDAP server. Or can be created by the Sysop only.

The Upload process was modified to work more like an Attachment.

Category Pages don't contain a seperate article;

"action=xml" was added so that MediaWiki could output XML, without any skin. This was used primarily for worldKit.

worldKit is a flash mapping application, that creates annotations from geoRSS. It's placed on the front page, with content transcluded from the News or Highlights section of a Country page. The page [MapRSS] supplies the geoRSS feed, with transcluded sections and predefined polygons for each country.

There are some remaining bugs in MediaWiki 1.4.7, when used with PHP5.05 (which this machine was recently updated to). The php error is "Only variables can be passed by reference", and affected just a few pages. php bug report


All File extensions are permitted as uploads, because logins are limited to undp and invited guests

$wgStrictFileExtensions = false;
$wgCheckFileExtensions = false;

Nav links are changed

$wgNavigationLinks = array (
	array( 'text'=>'mainpage',	'href'=>'mainpage' ),
        array( 'text'=>'general-resources',     'href'=>'general-resources-url'),
        array( 'text'=>'help', href=>'help'),
	array( 'text'=>'recentchanges', 'href'=>'recentchanges-url' ),

Uploads up to 10MB

$wgUploadSizeWarning = 10485760; /* 10 MB */

No Caching at all: because of section transclusion, cache invalidation doesn't happen. hasn't had any performance issues.

$wgEnableParserCache = false;
$wgCachePages = false;

Use the undp ldap auth

$wgAuth = new AuthPlugin();

Only logged in users can edit. Only sysop can create accounts.

$wgWhitelistEdit = true;
$wgWhitelistAccount = array ( 'user' => 0, 'sysop' => 1, 'developer' => 1);

Don't warn on file upload renames. This option is a local modificaition.

$wgUploadIgnoreRename = true;

No seperate article for Category pages.

$wgCategoryNoArticle = true;

Installed Extensions, Hacks, Bots

  • UploadLinks.php: developed for formatting of <Upload>Sample.doc</Upload>, used with attachments.
  • Project.php: <Project> and <Report> tags, for transclusion and formatting from these pages.
  • Bulk Page Creator is a bot used to autorecreate many pages from an initial spreadsheet.

All File Changes

  • AdminSettings.php : set with dbuser/password
  • LocalSettings.php : set with local settings

  • extensions/Project.php : new
  • extensions/UploadLinks.php : new
  • extensions/intersection/DynamicPageList.php : new (and modified from distrib)
  • extensions/kwBreadCrumbs.php : new and unchanged

  • worldkit/ : worldKit. Main Page map. uses Zoomify. RSS feed is /WaterWiki/index.php?title=MapRSS&action=xml

  • includes/Article.php: modified getSection() to retrieve section content by name. $noheading and $nospacing options. getTransclude() function.
  • includes/AuthPlugin.php: contacts UNDP ldap server for authentication
  • includes/CategoryPage.php: wgCategoryNoArticle, no seperate article for category pages
  • includes/DifferenceEngine.php: fixed "pass by reference" bug in php5.05
  • includes/EditPage.php: Starting article text hack. Edit form changes:no minor edit option, no watch option, no copyright warning, no help text. Modified edit buttons: bold/italic use html; removed other buttons.
  • includes/ImageGallery.php: added is_object check on thumbnail
  • includes/MagicWord.php: MAG_TABLESEC
  • includes/Parser.php: Many small mods. Transclusion support. MAG_TABLESEC support. Flash tags/attributes are legal. wgDontRemoveHTML. Allow atrributes in extension tags. <span> tag doesn't spark <p/>. Moved edit section button to after section. Catgory page links are not styled.
  • includes/Skin.php: Starting article text hack. suppressUrlExpansion (this screws up parsing blank lines, because was added to list of tags in parser to not add <p>'s after). Ability to pass in "style" to function makeKnownObj. "External" links pointing to the wiki are not styled.
  • includes/SkinTemplate.php: removed Talk and Preferences from personal urls. attachTo arg on upload.
  • includes/SpecialLog.php: fixed "pass by reference" bug in php5.05
  • includes/SpecialSearch.php: removed Power Search, and results text. Fixed "pass by reference" bug in php5.05
  • includes/SpecialUndelete.php: fixed "pass by reference" bug in php5.05
  • includes/SpecialUpload.php: attachTo option (inserts <Upload> tag). wgUploadIgnoreRename. Removed unnecessary text & instructions.
  • includes/SpecialUserlogin.php: Users can not create accounts.
  • includes/Title.php: Reserve Move for qualified users only.
  • includes/User.php: only sysop can move.
  • includes/templates/Userlogin.php: small interface changes

  • index.php: case "xml"

  • maintenance/tables.sql: change for installation issue
  • maintenance/rebuildMessages.php: failed attempt to subvert security controls

  • languages/Language.php: __TABLESEC__
  • skins/MonoBook.php: undp css. breadcrumbs extension. removed some sidebar links.
  • skins/common/images/wiki.png: undp
  • skins/common/wikibits.js: toggleIt function
  • skins/monobook/main.css: various style changes.

Did modify some messages in Special:Allmessages, but because shell access is limited, have not been able to run maintenance scripts which require command line access, as described in messages modification instructions.

Modification of the scripts to run from the server proved difficult. As a workaround, these have been directly modified in code (the last resort, yes).

Current Development Issues

We track development issues at Outstanding Dev Issues

1375 Rating: 1.8/5 (62 votes cast)