MediaWiki

Something else I've played around with over recent years has been MediaWiki which is the software that underlies Wikipedia and similar on-line open resources. I also run a copy of my laptop for quick and easy note-taking. MediaWiki is another of those FLOSS products which welcomes people writing their own extensions and this was a very simple one I needed so that I could display what server version, etc. the particular installation was running under.

if (!defined('MEDIAWIKI')) die('Not an entry point.');
define('SVRINFO_VERSION','0.9, 2007-10-19');
$wgExtensionFunctions[] = "wfSrvInfoExtension";
$wgExtensionCredits['parserhook'][] = array(
	'name'        => "Server Info",
	'author'      => 'Alison Wheeler',
	'description' => 'Displays Apache serverinfo data',
	'url'         => 'http://www.creative.org.uk/',
	'version'     => SVRINFO_VERSION
	);
//
function wfSrvInfoExtension() {
    global $wgParser;
    $wgParser->setHook( "svrinfo", "GetServerInfo" );
}
//
function GetServerInfo( $input, $argv, &$parser ) {
	global $wgUser;
	$currentUser = $wgUser->mName;
    $output = $_SERVER[$input];
    return $output;
}

Then just create a template which contains
<svrinfo>SERVER_SOFTWARE</svrinfo>
and there you have it!

· Last updated at: 10-Oct-2008 01:00 by Alison Wheeler ·
blinklist icon  blogmarks icon  del.ocio.us icon  digg icon  facebook icon  live.com icon  newsvine icon  reddit icon  slashdot icon  spurl icon  stumbleupon icon  technorati icon  yahoo! icon