Extension:BugSquish

From MediaWiki.org

Jump to: navigation, search

Note - the most up to date version of this documentation is available at http://www.kennel17.co.uk/testwiki/BugSquish.


Manual on MediaWiki Extensions
List of MediaWiki Extensions
BugSquish

Release status: stable

Implementation Parser extension
Description An extension to cross out closed Bugzilla bugs.
Author(s) Mark Clements (HappyDog Talk)
Version check http://www.kennel17.co.uk/testwiki/BugSquish for latest version.
Download Source is available at my test wiki

This extension checks your Bugzilla installation and adds a strikethrough to interwiki links for closed bugs.

Contents

[edit] Installation

Simply copy and paste the code (below) into a new file in your 'extensions' directory and include() it from your LocalSettings.php file in the usual way.

[edit] Requirements

Firstly, links to your Bugzilla installation need to be setup in your interwiki table. For example you might setup an interwiki link called bug with the URL http://www.example.com/bugzilla/show_bug.cgi?id=$1. This means you can enter the wiki code [[bug:2314]] to create a link to bug 2314 in your Bugzilla install (resulting in a link such as: bug:2314).

For BugSquish to work are you need to have an interwiki prefix that accepts just a single number, and that the DB containing the bugs must be accessible locally (though the code is designed to allow for alternative access to the Bugzilla data (e.g. via WebDAV)... so long as someone fills in the necessary code!).

Multiple interwiki prefixes to different Bugzillas can be defined, but currently the code only works with Bugzilla installations - no other bugtrack systems are currently supported.

[edit] Configuration

For each interwiki link that you want to use, you need to add an entry into $wgBugSquishSources. Each entry has the following required elements:

  • interwiki => The interwiki prefix this definition applies to.
  • type => The type of connection. Currently only BUGSQUISH_DBConnect is valid for this field.


The following elements are only required if necessary:

  • prefix => DB prefix (as setup in your Bugzilla installation - can be omitted if no prefix used).


The following optional elements can be used to define the database connection. If any of the elements are omitted, then the values used for your MediaWiki installation are used. Therefore if Bugzilla shares a database with MediaWiki (and the MediaWiki user has appropriate access privileges) then you can omit all of the settings. If not, then fill in anything that differs from your MediaWiki install.

  • host => The database host.
  • database => The database name.
  • user => Username for DB connection.
  • password => Password for DB connection.


[edit] Examples

[edit] Example 1 - shared DB

If MediaWiki and Bugzilla are installed in a single DB, then you only need to specify a minimal set of components:

include("extensions/BugSquish.php");
 
$wgBugSquishSources[] = array(
        'interwiki'    => "bug",
        'type'         => BUGSQUISH_DBConnect,
        'prefix'       => "bugzilla_",
);

[edit] Example 1 - separate DB

If Bugzilla is stored in a separate DB, then you need to supply details. In most cases 'host' will be the same as for MediaWiki, in which case it can be omitted (as it has been here). Also if no table prefix is used in your Bugzilla install, then that field can be omitted.

include("extensions/BugSquish.php");
 
$wgBugSquishSources[] = array(
        'interwiki'    => "bug",
        'type'         => BUGSQUISH_DBConnect,
        'database'     => "dbname",
        'user'         => "dbuser",
        'password'     => "dbpass",
);

[edit] Source Code

Available from http://www.kennel17.co.uk/testwiki/BugSquish.

Personal tools