From d4f2f71384a1a4bf2a6f237462a19147d4e042e8 Mon Sep 17 00:00:00 2001 From: CosmicAlpha Date: Mon, 27 Feb 2023 13:02:41 -0700 Subject: [PATCH] Use ExtensionRegistry::getAllThings() to get version (#220) --- includes/Hooks.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/Hooks.php b/includes/Hooks.php index 47fd3642..c1b970ea 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -3,6 +3,7 @@ namespace MediaWiki\Extension\DynamicPageList3; use DatabaseUpdater; +use ExtensionRegistry; use MediaWiki\Extension\DynamicPageList3\Maintenance\CreateTemplate; use MediaWiki\Extension\DynamicPageList3\Maintenance\CreateView; use Parser; @@ -82,7 +83,7 @@ public static function getVersion(): string { static $version = null; if ( $version === null ) { - $version = json_decode( file_get_contents( __DIR__ . '/../extension.json' ) )->version; + $version = ExtensionRegistry::getInstance()->getAllThings()['DynamicPageList3']['version']; } return $version;