StatGraphs-Extension

Maintains some additional statistical DB tables and generates charts in PNG fomat for display in the wiki.

License
GPL.

Requirements

 * PERL
 * PERL modules DBI (plus the interface for your DB) and Chart.
 * System privilege for running daily cron jobs.

Installation
Download from mediawiki/trunk/extensions/StatGraphs/. Copy StatGraphs.php and the data/ folder into the StatGraphs subfolder of the extensions folder of your MediaWiki installation. Create subfolders in the data/ folder, one for each wiki you want to have statistical graphs for. The name of the subfolder must be the same as the wiki's $wgLocalInterwiki. Then add the following line to your LocalSettings.php file (near the end):

Copy the maintenance/StatGraphs/ folder into MediaWiki's maintenance folder on each wiki. Add the tables in tables/tables.sql into the wikis' DB schema. Each wiki needs its own tables.

Usage
Before generating any graph, you need to fill the statistical tables. cd to the wiki's maintenance/StatGraphs/ folder and run

php StatsDbTables.php

This will take a while. It extracts all needed statistical data from various MW tables.

Do this for each wiki.

Once you have initialized the statistical tabels, you can generate the graphs by running

php StatsTblChrt.php

This will generate various statistical graphs in the data/ subfolder corresponding to your wiki.

In order to display this graphs, this extensions adds a HTML like tag named "statgraph". It expects the name of the graph in the attribute "name". For example, if you want to display the graph with the Overview on the numbers of articles, use this wiki markup:



It is recommended to do the update of the statistical DB tables and the generation of graphs by a system cron job. When updating the statistical DB tables, run StatsDbTables.php wit hthe command line argument --incremental and send ist output to /dev/null. A simple cron script might look like this: