diff --git a/SETUP/MediaWiki_extensions/README.md b/SETUP/MediaWiki_extensions/README.md index 8d864695ba..6f77e261e1 100644 --- a/SETUP/MediaWiki_extensions/README.md +++ b/SETUP/MediaWiki_extensions/README.md @@ -1,6 +1,6 @@ # MediaWiki Extensions These MediaWiki extensions enable the use of Magic Tags to show project -information on a wiki page. +information on a wiki page. These extensions support MediaWiki 1.32 and later. ## Requirements These assume that the MediaWiki tables and the DP tables are running in the @@ -13,9 +13,10 @@ To use them: 1. Copy the files to your MediaWiki `extensions/` directory 2. Edit the files and update `$relPath` to point to your DP `c/pinc/` directory 3. Add the following lines to your MediaWiki `LocalSettings.php` file: - +```php require_once('extensions/dpExtensions.php'); require_once('extensions/hospitalExtensions.php'); +``` ## Magic Tags provided The following magic tags are provided: diff --git a/SETUP/MediaWiki_extensions/dpExtensions.php b/SETUP/MediaWiki_extensions/dpExtensions.php index 4ed38cb447..c16a1fc287 100644 --- a/SETUP/MediaWiki_extensions/dpExtensions.php +++ b/SETUP/MediaWiki_extensions/dpExtensions.php @@ -34,8 +34,8 @@ function wfPgFormats() { - global $wgParser; - $wgParser->setHook("pg_formats", "getPgFormats"); + $parser = \MediaWiki\MediaWikiServices::getInstance()->getParser(); + $parser->setHook("pg_formats", "getPgFormats"); } function getPgFormats($input, $argv) @@ -85,8 +85,8 @@ function getPgFormats($input, $argv) function wfProjectInfo() { - global $wgParser; - $wgParser->setHook("projectinfo", "showProjectInfo"); + $parser = \MediaWiki\MediaWikiServices::getInstance()->getParser(); + $parser->setHook("projectinfo", "showProjectInfo"); } function showProjectInfo($input, $argv, $parser) diff --git a/SETUP/MediaWiki_extensions/hospitalExtensions.php b/SETUP/MediaWiki_extensions/hospitalExtensions.php index 79db88a89e..14db03a381 100644 --- a/SETUP/MediaWiki_extensions/hospitalExtensions.php +++ b/SETUP/MediaWiki_extensions/hospitalExtensions.php @@ -33,8 +33,8 @@ function wfHospitalInfo() { - global $wgParser; - $wgParser->setHook("hospital_info", "listHospitalProjects"); + $parser = \MediaWiki\MediaWikiServices::getInstance()->getParser(); + $parser->setHook("hospital_info", "listHospitalProjects"); } function listHospitalProjects($input, $argv)