diff options
author | 2019-11-27 09:35:05 -0500 | |
---|---|---|
committer | 2019-11-27 09:35:05 -0500 | |
commit | 39a3689ad0d2eb04cffe8465311dfc412e013567 (patch) | |
tree | 8766b6af5ed7e32156691fa1b9d3f51f42a73c4c | |
parent | Create symlinks to all the MLEB extensions for ease of installation (diff) | |
download | extensions-39a3689ad0d2eb04cffe8465311dfc412e013567.tar.gz extensions-39a3689ad0d2eb04cffe8465311dfc412e013567.tar.bz2 extensions-39a3689ad0d2eb04cffe8465311dfc412e013567.zip |
Future proof GentooPackages with Http:: being deprecated
Signed-off-by: Brian Evans <grknight@gentoo.org>
-rw-r--r-- | GentooPackages/GentooPackages.php | 6 |
1 files changed, 5 insertions, 1 deletions
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 '<div class="alert alert-danger">Cannot load package information. Is the atom <em>' . htmlspecialchars($atom) . '</em> correct?</div>'; |