jenkins-bot has submitted this change and it was merged.

Change subject: Add extension.json, empty php entry point
......................................................................


Add extension.json, empty php entry point

Bug: T87961
Change-Id: I52e93fd290b1e5d8438467896a159fc7230c5813
---
M Popups.php
A extension.json
2 files changed, 60 insertions(+), 28 deletions(-)

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



diff --git a/Popups.php b/Popups.php
index e2a9312..8b2aa62 100644
--- a/Popups.php
+++ b/Popups.php
@@ -24,31 +24,15 @@
  * @ingroup extensions
  */
 
-$wgExtensionCredits['betafeatures'][] = array(
-       'author' => array( 'Prateek Saxena', 'Yair Rand' ),
-       'descriptionmsg' => 'popups-desc',
-       'name' => 'Popups',
-       'path' => __FILE__,
-       'url' => 'https://www.mediawiki.org/wiki/Extension:Popups',
-       'license-name' => 'GPL-2.0+',
-);
-
-/**
- * @var bool: Whether the extension should be enabled as an opt-in beta 
feature.
- * If true, the BetaFeatures extension must be installed. False by default.
- */
-$wgPopupsBetaFeature = false;
-
-$wgPopupsSurveyLink = false;
-$wgConfigRegistry['popups'] = 'GlobalVarConfig::newInstance';
-
-$wgAutoloadClasses['PopupsHooks'] = __DIR__ . '/Popups.hooks.php';
-$wgMessagesDirs['Popups'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['Popups'] = __DIR__ . '/Popups.i18n.php';
-
-$wgHooks['GetBetaFeaturePreferences'][] = 'PopupsHooks::getPreferences';
-$wgHooks['BeforePageDisplay'][] = 'PopupsHooks::onBeforePageDisplay';
-$wgHooks['ResourceLoaderTestModules'][] = 
'PopupsHooks::onResourceLoaderTestModules';
-$wgHooks['EventLoggingRegisterSchemas'][] = 
'PopupsHooks::onEventLoggingRegisterSchemas';
-$wgHooks['ResourceLoaderRegisterModules'][] = 
'PopupsHooks::onResourceLoaderRegisterModules';
-$wgHooks['ResourceLoaderGetConfigVars'][] = 
'PopupsHooks::onResourceLoaderGetConfigVars';
+if ( function_exists( 'wfLoadExtension' ) ) {
+       wfLoadExtension( 'Popups' );
+       // Keep i18n globals so mergeMessageFileList.php doesn't break
+       $wgMessagesDirs['Popups'] = __DIR__ . '/i18n';
+       /* wfWarn(
+               'Deprecated PHP entry point used for Popups extension. Please 
use wfLoadExtension instead, ' .
+               'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+       ); */
+       return;
+} else {
+       die( 'This version of the Popups extension requires MediaWiki 1.25+' );
+}
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..56111f6
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,48 @@
+{
+       "name": "Popups",
+       "author": [
+               "Prateek Saxena",
+               "Yair Rand"
+       ],
+       "url": "https://www.mediawiki.org/wiki/Extension:Popups";,
+       "descriptionmsg": "popups-desc",
+       "license-name": "GPL-2.0+",
+       "type": "betafeatures",
+       "AutoloadClasses": {
+               "PopupsHooks": "Popups.hooks.php"
+       },
+       "ConfigRegistry": {
+               "popups": "GlobalVarConfig::newInstance"
+       },
+       "Hooks": {
+               "GetBetaFeaturePreferences": [
+                       "PopupsHooks::getPreferences"
+               ],
+               "BeforePageDisplay": [
+                       "PopupsHooks::onBeforePageDisplay"
+               ],
+               "ResourceLoaderTestModules": [
+                       "PopupsHooks::onResourceLoaderTestModules"
+               ],
+               "EventLoggingRegisterSchemas": [
+                       "PopupsHooks::onEventLoggingRegisterSchemas"
+               ],
+               "ResourceLoaderRegisterModules": [
+                       "PopupsHooks::onResourceLoaderRegisterModules"
+               ],
+               "ResourceLoaderGetConfigVars": [
+                       "PopupsHooks::onResourceLoaderGetConfigVars"
+               ]
+       },
+       "MessagesDirs": {
+               "Popups": [
+                       "i18n"
+               ]
+       },
+       "config": {
+               "@PopupsBetaFeature": "@var bool: Whether the extension should 
be enabled as an opt-in beta feature. If true, the BetaFeatures extension must 
be installed. False by default.",
+               "PopupsBetaFeature": false,
+               "PopupsSurveyLink": false
+       },
+       "manifest_version": 1
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I52e93fd290b1e5d8438467896a159fc7230c5813
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Prtksxna <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: Prtksxna <[email protected]>
Gerrit-Reviewer: Ricordisamoa <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to