From 39a3689ad0d2eb04cffe8465311dfc412e013567 Mon Sep 17 00:00:00 2001 From: Brian Evans Date: Wed, 27 Nov 2019 09:35:05 -0500 Subject: Future proof GentooPackages with Http:: being deprecated Signed-off-by: Brian Evans --- GentooPackages/GentooPackages.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/GentooPackages/GentooPackages.php b/GentooPackages/GentooPackages.php index 3f38dd46..fe73bda4 100644 --- a/GentooPackages/GentooPackages.php +++ b/GentooPackages/GentooPackages.php @@ -13,7 +13,11 @@ class GentooPackages { } static function fetchOrError($atom, $type) { - $json_str = Http::get("https://packages.gentoo.org/packages/${atom}.json"); + global $wgVersion; + if(version_compare( $wgVersion, '1.33', '<=' )) + $json_str = Http::get("https://packages.gentoo.org/packages/${atom}.json"); + else + $json_str = \MediaWiki\Http\HttpRequestFactory::get("https://packages.gentoo.org/packages/${atom}.json"); if ($json_str === false) { return '
Cannot load package information. Is the atom ' . htmlspecialchars($atom) . ' correct?
'; -- cgit v1.2.3-65-gdbad