Skip to content

Commit 5cfee60

Browse files
committed
Update MediaWiki extensions to support MW 1.39
Update the DP MediaWiki extensions to support MediaWiki 1.32 and later, including 1.39 which is the latest LTS.
1 parent 096f1f3 commit 5cfee60

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

SETUP/MediaWiki_extensions/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MediaWiki Extensions
22
These MediaWiki extensions enable the use of Magic Tags to show project
3-
information on a wiki page.
3+
information on a wiki page. These extensions support MediaWiki 1.32 and later.
44

55
## Requirements
66
These assume that the MediaWiki tables and the DP tables are running in the
@@ -13,9 +13,10 @@ To use them:
1313
1. Copy the files to your MediaWiki `extensions/` directory
1414
2. Edit the files and update `$relPath` to point to your DP `c/pinc/` directory
1515
3. Add the following lines to your MediaWiki `LocalSettings.php` file:
16-
16+
```php
1717
require_once('extensions/dpExtensions.php');
1818
require_once('extensions/hospitalExtensions.php');
19+
```
1920

2021
## Magic Tags provided
2122
The following magic tags are provided:

SETUP/MediaWiki_extensions/dpExtensions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434

3535
function wfPgFormats()
3636
{
37-
global $wgParser;
38-
$wgParser->setHook("pg_formats", "getPgFormats");
37+
$parser = \MediaWiki\MediaWikiServices::getInstance()->getParser();
38+
$parser->setHook("pg_formats", "getPgFormats");
3939
}
4040

4141
function getPgFormats($input, $argv)
@@ -85,8 +85,8 @@ function getPgFormats($input, $argv)
8585

8686
function wfProjectInfo()
8787
{
88-
global $wgParser;
89-
$wgParser->setHook("projectinfo", "showProjectInfo");
88+
$parser = \MediaWiki\MediaWikiServices::getInstance()->getParser();
89+
$parser->setHook("projectinfo", "showProjectInfo");
9090
}
9191

9292
function showProjectInfo($input, $argv, $parser)

SETUP/MediaWiki_extensions/hospitalExtensions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333

3434
function wfHospitalInfo()
3535
{
36-
global $wgParser;
37-
$wgParser->setHook("hospital_info", "listHospitalProjects");
36+
$parser = \MediaWiki\MediaWikiServices::getInstance()->getParser();
37+
$parser->setHook("hospital_info", "listHospitalProjects");
3838
}
3939

4040
function listHospitalProjects($input, $argv)

0 commit comments

Comments
 (0)