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

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


Convert DeleteBatch to use extension registration

Bug: T180818
Change-Id: Ibca3f2d3bbb4c9b6128a26ed6c95f50c1ea310f0
---
M DeleteBatch.php
A extension.json
2 files changed, 71 insertions(+), 40 deletions(-)

Approvals:
  Mainframe98: Looks good to me, but someone else must approve
  20after4: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/DeleteBatch.php b/DeleteBatch.php
index fcd77ca..4f91483 100644
--- a/DeleteBatch.php
+++ b/DeleteBatch.php
@@ -1,43 +1,35 @@
 <?php
 /**
- * DeleteBatch - a special page to delete a batch of pages
- *
- * @file
- * @ingroup Extensions
- * @author Bartek Łapiński <bar...@wikia-inc.com>
- * @version 1.6.0
- * @license https://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
- * @link https://www.mediawiki.org/wiki/Extension:DeleteBatch Documentation
- */
-
-// Ensure that the script cannot be executed outside of MediaWiki.
-if ( !defined( 'MEDIAWIKI' ) ) {
-       die( 'This is an extension to MediaWiki and cannot be run standalone.' 
);
+* DeleteBatch - a special page to delete a batch of pages
+*
+* Copyright (C) 2008, Bartek Łapiński <bar...@wikia-inc.com>
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor,
+* Boston, MA  02110-1301, USA.
+*/
+if ( function_exists( 'wfLoadExtension' ) ) {
+       wfLoadExtension( 'DeleteBatch' );
+       // Keep i18n globals so mergeMessageFileList.php doesn't break
+       $wgMessagesDirs['DeleteBatch'] = __DIR__ . '/i18n';
+       $wgExtensionMessagesFiles['DeleteBatchAlias'] = __DIR__ . 
'/DeleteBatch.alias.php';
+       wfWarn(
+               'Deprecated PHP entry point used for the DeleteBatch extension. 
' .
+               'Please use wfLoadExtension instead, ' .
+               'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+       );
+       return;
+} else {
+       die( 'This version of the DeleteBatch extension requires MediaWiki 
1.29+' );
 }
-// Extension credits that will show up on Special:version
-$wgExtensionCredits['specialpage'][] = array(
-       'path' => __FILE__,
-       'name' => 'Delete Batch',
-       'version' => '1.6.0',
-       'author' => array(
-               'Bartek Łapiński',
-               '...'
-       ),
-       'url' => 'https://www.mediawiki.org/wiki/Extension:DeleteBatch',
-       'descriptionmsg' => 'deletebatch-desc',
-       'license-name' => 'GPL-2.0-or-later'
-);
-
-// New user right, required to use Special:DeleteBatch
-$wgAvailableRights[] = 'deletebatch';
-$wgGroupPermissions['bureaucrat']['deletebatch'] = true;
-
-// Set up the new special page
-$wgMessagesDirs['DeleteBatch'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['DeleteBatchAlias'] = __DIR__ . 
'/DeleteBatch.alias.php';
-$wgAutoloadClasses['SpecialDeleteBatch'] = __DIR__ . '/DeleteBatch.body.php';
-$wgAutoloadClasses['DeleteBatchForm'] = __DIR__ . '/DeleteBatch.body.php';
-$wgSpecialPages['DeleteBatch'] = 'SpecialDeleteBatch';
-
-// Hooks
-$wgHooks['AdminLinks'][] = 'SpecialDeleteBatch::addToAdminLinks'; // Admin 
Links extension
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..bd4cc0f
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,39 @@
+{
+       "name": "DeleteBatch",
+       "version": "1.7.0",
+       "author": [
+               "Bartek Łapiński",
+               "..."
+       ],
+       "url": "https://www.mediawiki.org/wiki/Extension:DeleteBatch";,
+       "descriptionmsg": "deletebatch-desc",
+       "license-name": "GPL-2.0-or-later",
+       "type": "specialpage",
+       "AvailableRights": [
+               "deletebatch"
+       ],
+       "GroupPermissions": {
+               "bureaucrat": {
+                       "deletebatch": true
+               }
+       },
+       "SpecialPages": {
+               "DeleteBatch": "SpecialDeleteBatch"
+       },
+       "MessagesDirs": {
+               "DeleteBatch": [
+                       "i18n"
+               ]
+       },
+       "ExtensionMessagesFiles": {
+               "DeleteBatchAlias": "DeleteBatch.alias.php"
+       },
+       "AutoloadClasses": {
+               "SpecialDeleteBatch": "DeleteBatch.body.php",
+               "DeleteBatchForm": "DeleteBatch.body.php"
+       },
+       "Hooks": {
+               "AdminLinks": "SpecialDeleteBatch::addToAdminLinks"
+       },
+       "manifest_version": 2
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibca3f2d3bbb4c9b6128a26ed6c95f50c1ea310f0
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/DeleteBatch
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio <maure...@tools.wmflabs.org>
Gerrit-Reviewer: 20after4 <mmod...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Mainframe98 <k.s.w...@hotmail.com>
Gerrit-Reviewer: MarcoAurelio <maure...@tools.wmflabs.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