Reception123 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/374683 )

Change subject: Convert GroupsSidebar to use extension registration
......................................................................

Convert GroupsSidebar to use extension registration

Bug: T174529
Change-Id: Ie29fbf4e35d76f98745f0d6b090b31b3adf790d0
---
M GroupsSidebar.php
A extension.json
2 files changed, 36 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GroupsSidebar 
refs/changes/83/374683/1

diff --git a/GroupsSidebar.php b/GroupsSidebar.php
index 1c4d5cd..f91bbc4 100644
--- a/GroupsSidebar.php
+++ b/GroupsSidebar.php
@@ -1,21 +1,12 @@
 <?php
-# Alert the user that this is not a valid entry point to MediaWiki if they try 
to access the special pages file directly.
-if (!defined('MEDIAWIKI')) {
-       exit( 1 );
+if ( function_exists( 'wfLoadExtension' ) ) {
+       wfLoadExtension( 'GroupsSidebar' );
+       wfWarn(
+               'Deprecated PHP entry point used for GroupsSidebar extension. ' 
.
+               'Please use wfLoadExtension instead, ' .
+               'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+       );
+       return;
+} else {
+       die( 'This version of the GroupsSidebar extension requires MediaWiki 
1.29+' );
 }
-
-$wgExtensionCredits['parserhook'][] = array(
-       'path' => __FILE__,
-       'name' => 'GroupsSidebar',
-       'author' => 'Church of emacs',
-       'url' => 'https://www.mediawiki.org/wiki/Extension:GroupsSidebar',
-       'descriptionmsg' => 'groupssidebar-desc',
-       'version' => '0.2.0',
-);
-
-$dir = dirname(__FILE__) . '/';
-
-$wgAutoloadClasses['GroupsSidebar'] = $dir . 'GroupsSidebar.body.php'; # Tell 
MediaWiki to load the extension body.
-$wgHooks['SkinBuildSidebar'][] = array(new GroupsSidebar(), 'efHideSidebar');
-$wgMessagesDirs['GroupsSidebar'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['GroupsSidebar'] = $dir . 'GroupsSidebar.i18n.php';
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..7f0f510
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,26 @@
+{
+       "name": "GroupsSidebar",
+       "version": "0.2.0",
+       "author": [
+               "[https://www.mediawiki.org/wiki/User:Church_of_emacs Church of 
emacs]"
+       ],
+       "type": "parserhook",
+       "url": "https://www.mediawiki.org/wiki/Extension:GroupsSidebar";,
+       "descriptionmsg": "groupssidebar-desc",
+       "license-name": "GPL-2.0+",
+       "AutoloadClasses": {
+               "GroupsSidebar": "GroupsSidebar.body.php"
+       },
+       "MessagesDirs": {
+               "GroupsSidebar": [
+                       "i18n"
+               ]
+       },
+       "ExtensionMessagesFiles": {
+               "GroupsSidebar": "GroupsSidebar.i18n.php"
+       },
+       "Hooks": {
+               "SkinBuildSidebar: GroupsSidebar::efHideSidebar"
+       },
+       "manifest_version": 2
+}
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/374683
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie29fbf4e35d76f98745f0d6b090b31b3adf790d0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GroupsSidebar
Gerrit-Branch: master
Gerrit-Owner: Reception123 <utilizator.receptie...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to