jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/405401 )

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


Convert Tabs to use extension registration

Bug: T185371
Change-Id: I4041813e6e7df0fcde317fbdbb0df913e9c1a575
---
M Tabs.php
A extension.json
2 files changed, 55 insertions(+), 29 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/Tabs.php b/Tabs.php
index c69f10f..cf18a2c 100644
--- a/Tabs.php
+++ b/Tabs.php
@@ -24,32 +24,16 @@
  * @file
  */
 
-$wgExtensionCredits['parserhook'][] = array(
-       'path'           => __FILE__,
-       'name'           => 'Tabs',
-       'author'         => 'Joeytje50',
-       'url'            => 'https://www.mediawiki.org/wiki/Extension:Tabs',
-       'descriptionmsg' => 'tabs-desc',
-       'version'        => '1.3.2',
-       'license-name'   => 'GPL-2.0+'
-);
-
-$dir = __DIR__ . '/';
-$wgMessagesDirs['Tabs'] = __DIR__ . '/i18n';
-$wgAutoloadClasses['Tabs'] = $dir . 'Tabs.body.php';
-$wgExtensionMessagesFiles['TabsMagic'] =  $dir . 'Tabs.i18n.magic.php';
-$wgHooks['ParserFirstCallInit'][] = 'Tabs::init';
-$wgResourceModules['ext.tabs'] = array(
-       'scripts' => 'ext.tabs.js',
-       'styles' => 'ext.tabs.css',
-       'messages' => array(
-               'tabs-tab-label',
-               'tabs-toggle-open',
-               'tabs-toggle-close',
-               'tabs-dropdown-label',
-               'tabs-dropdown-bgcolor',
-       ),
-       'localBasePath' => __DIR__,
-       'remoteExtPath' => 'Tabs',
-       'position' => 'top',
-);
+ if ( function_exists( 'wfLoadExtension' ) ) {
+       wfLoadExtension( 'Tabs' );
+       // Keep i18n globals so mergeMessageFileList.php doesn't break
+       $wgMessagesDirs['Tabs'] = __DIR__ . '/i18n';
+       wfWarn(
+               'Deprecated PHP entry point used for the Tabs extension. ' .
+               'Please use wfLoadExtension instead, ' .
+               'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+       );
+       return;
+} else {
+       die( 'This version of the Tabs extension requires MediaWiki 1.29+' );
+}
\ No newline at end of file
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..3932040
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,42 @@
+{
+       "name": "Tabs",
+       "version": "1.3.2",
+       "author": "Joeytje50",
+       "url": "https://www.mediawiki.org/wiki/Extension:Tabs";,
+       "descriptionmsg": "tabs-desc",
+       "license-name": "GPL-2.0+",
+       "type": "parserhook",
+       "MessagesDirs": {
+               "Tabs": [
+                       "i18n"
+               ]
+       },
+       "ExtensionMessagesFiles": {
+               "TabsMagic": "Tabs.i18n.magic.php"
+       },
+       "AutoloadClasses": {
+               "Tabs": "Tabs.body.php"
+       },
+       "ResourceModules": {
+               "ext.tabs": {
+                       "scripts": "ext.tabs.js",
+                       "styles": "ext.tabs.css",
+                       "messages": [
+                               "tabs-tab-label",
+                               "tabs-toggle-open",
+                               "tabs-toggle-close",
+                               "tabs-dropdown-label",
+                               "tabs-dropdown-bgcolor"
+                       ],
+                       "position": "top"
+               }
+       },
+       "ResourceFileModulePaths": {
+               "localBasePath": "",
+               "remoteExtPath": "Tabs"
+       },
+       "Hooks": {
+               "ParserFirstCallInit": "Tabs::init"
+       },
+       "manifest_version": 2
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4041813e6e7df0fcde317fbdbb0df913e9c1a575
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Tabs
Gerrit-Branch: master
Gerrit-Owner: Jayprakash12345 <0freerunn...@gmail.com>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Johnduhart <j...@compwhizii.net>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Mainframe98 <k.s.w...@hotmail.com>
Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to