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: T88048
Change-Id: I9fa3f87f3e099440f8e680fcc95895a220d67353
---
M DisableAccount.php
A DisableAccountLogFormatter.php
A extension.json
3 files changed, 56 insertions(+), 35 deletions(-)

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



diff --git a/DisableAccount.php b/DisableAccount.php
index 803a2ca..6762afc 100644
--- a/DisableAccount.php
+++ b/DisableAccount.php
@@ -1,37 +1,14 @@
 <?php
-// DisableAccount extension: quick extension to disable an account.
-// Written by Andrew Garrett, 2010-12-02
-
-$wgExtensionCredits['other'][] = array(
-       'path' => __FILE__,
-       'name' => 'Disable Account',
-       'author' => array( 'Andrew Garrett' ),
-       'url' => 'https://www.mediawiki.org/wiki/Extension:DisableAccount',
-       'descriptionmsg' => 'disableaccount-desc',
-);
-
-$dir = __DIR__ . '/';
-
-$wgMessagesDirs['DisableAccount'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['DisableAccountAliases'] = $dir . 
'DisableAccount.alias.php';
-
-// Special page classes
-$wgAutoloadClasses['SpecialDisableAccount'] = $dir . 'DisableAccount_body.php';
-$wgSpecialPages['DisableAccount'] = 'SpecialDisableAccount';
-
-// Add permission required to use Special:DisableAccount
-$wgAvailableRights[] = 'disableaccount';
-
-// Log
-$wgLogActionsHandlers['block/disableaccount'] = 'DisableAccountLogFormatter';
-
-class DisableAccountLogFormatter extends LogFormatter {
-       protected function getMessageParameters() {
-               $params = parent::getMessageParameters();
-               if ( count( $params ) == 3 ) {
-                       // Deal with old log entries which don't have this set 
(needed for GENDER support)
-                       $params[3] = $this->entry->getTarget()->getRootText();
-               }
-               return $params;
-       }
+if ( function_exists( 'wfLoadExtension' ) ) {
+       wfLoadExtension( 'DisableAccount' );
+       // Keep i18n globals so mergeMessageFileList.php doesn't break
+       $wgMessagesDirs['DisableAccount'] = __DIR__ . '/i18n';
+       $wgExtensionMessagesFiles['DisableAccountAliases'] = __DIR__ . 
'/DisableAccount.alias.php';
+       /* wfWarn(
+               'Deprecated PHP entry point used for DisableAccount extension. 
Please use wfLoadExtension instead, ' .
+               'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+       ); */
+       return;
+} else {
+       die( 'This version of the DisableAccount extension requires MediaWiki 
1.25+' );
 }
diff --git a/DisableAccountLogFormatter.php b/DisableAccountLogFormatter.php
new file mode 100644
index 0000000..6137a37
--- /dev/null
+++ b/DisableAccountLogFormatter.php
@@ -0,0 +1,12 @@
+<?php
+
+class DisableAccountLogFormatter extends LogFormatter {
+       protected function getMessageParameters() {
+               $params = parent::getMessageParameters();
+               if ( count( $params ) == 3 ) {
+                       // Deal with old log entries which don't have this set 
(needed for GENDER support)
+                       $params[3] = $this->entry->getTarget()->getRootText();
+               }
+               return $params;
+       }
+}
\ No newline at end of file
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..5079868
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,32 @@
+{
+       "@doc": "DisableAccount extension: quick extension to disable an 
account.",
+       "@doc": "Written by Andrew Garrett, 2010-12-02",
+       "name": "Disable Account",
+       "author": [
+               "Andrew Garrett"
+       ],
+       "url": "https://www.mediawiki.org/wiki/Extension:DisableAccount";,
+       "descriptionmsg": "disableaccount-desc",
+       "type": "other",
+       "ExtensionMessagesFiles": {
+               "DisableAccountAliases": "DisableAccount.alias.php"
+       },
+       "MessagesDirs": {
+               "DisableAccount": [
+                       "i18n"
+               ]
+       },
+       "LogActionsHandlers": {
+               "block/disableaccount": "DisableAccountLogFormatter"
+       },
+       "AvailableRights": [
+               "disableaccount"
+       ],
+       "SpecialPages": {
+               "DisableAccount": "SpecialDisableAccount"
+       },
+       "AutoloadClasses": {
+               "SpecialDisableAccount": "DisableAccount_body.php",
+               "DisableAccountLogFormatter": "DisableAccountLogFormatter.php"
+       }
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9fa3f87f3e099440f8e680fcc95895a220d67353
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/DisableAccount
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Alex Monk <kren...@gmail.com>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: Yurik <yu...@wikimedia.org>
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