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

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


Convert to use extension registration

Change-Id: I70141958c40d6269f7a828b31047fd20b9bfc5ed
---
M UpdateMediaWiki.php
A extension.json
2 files changed, 43 insertions(+), 32 deletions(-)

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



diff --git a/UpdateMediaWiki.php b/UpdateMediaWiki.php
index 8ce1162..f534da4 100644
--- a/UpdateMediaWiki.php
+++ b/UpdateMediaWiki.php
@@ -1,35 +1,16 @@
 <?php
 
-/*********************************************************************
-**
-** This file is part of the UpdateMediaWiki extension for MediaWiki
-* @file
-* @ingroup Extensions
-* @author Miguel Peláez <miguel2706outlook.com>
-* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 
or later
-* @link http://www.mediawiki.org/wiki/Extension:UpdateMediaWiki Documentation
-**********************************************************************/
-
-# Alert the user that this is not a valid access point to MediaWiki if they 
try to access the special pages file directly.
-if ( !defined( 'MEDIAWIKI' ) ) {
-               echo <<<EOT
-To install updatemediawiki extension, put the following line in 
LocalSettings.php:
-require_once( "\$IP/extensions/updatemediawiki/updatemediawiki.php" );
-EOT;
-       exit( 1 );
+if ( function_exists( 'wfLoadExtension' ) ) {
+       wfLoadExtension( 'UpdateMediaWiki' );
+       // Keep i18n globals so mergeMessageFileList.php doesn't break
+       $wgMessagesDirs['UpdateMediaWiki'] = __DIR__ . '/i18n';
+       $wgExtensionMessagesFiles['updatemediawikiAlias'] = __DIR__ . 
'/updatemediawiki.alias.php';
+       wfWarn(
+               'Deprecated PHP entry point used for FooBar extension. ' .
+               'Please use wfLoadExtension instead, ' .
+               'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+       );
+       return;
+} else {
+       die( 'This version of the UpdateMediaWiki extension requires MediaWiki 
1.25+' );
 }
-
-$wgExtensionCredits['specialpage'][] = array(
-       'path' => __FILE__,
-       'name' => 'UpdateMediaWiki',
-       'author' =>'Miguel Peláez',
-       'url' => 'https://www.mediawiki.org/wiki/Extension:UpdateMediaWiki',
-       'descriptionmsg' => 'updatemediawiki-desc',
-       'version'  => '0.3.0',
-);
-
-$wgAutoloadClasses[ 'Specialupdatemediawiki' ] = __DIR__ . 
'/specialupdatemediawiki.php';
-$wgMessagesDirs['UpdateMediaWiki'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles[ 'updatemediawiki' ] = __DIR__ . 
'/updatemediawiki.i18n.php';
-$wgSpecialPages[ 'updatemediawiki' ] = 'Specialupdatemediawiki';
-$wgExtensionMessagesFiles['updatemediawikiAlias'] = __DIR__ . 
'/updatemediawiki.alias.php';
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..002764c
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,30 @@
+{
+       "name": "UpdateMediaWiki",
+       "version": "0.4.0",
+       "author": [
+               "Miguel Pelaez"
+       ],
+       "url": "https://www.mediawiki.org/wiki/Extension:UpdateMediaWiki";,
+       "descriptionmsg": "updatemediawiki-desc",
+       "license-name": "GPL-2.0+",
+       "type": "extensions",
+       "requires": {
+               "MediaWiki": ">= 1.25.0"
+       },
+       "SpecialPages": {
+               "updatemediawiki": "Specialupdatemediawiki"
+       },
+       "MessagesDirs": {
+               "UpdateMediaWiki": [
+                       "i18n"
+               ]
+       },
+       "ExtensionMessagesFiles": {
+               "updatemediawiki": "updatemediawiki.i18n.php",
+               "updatemediawikiAlias": "updatemediawiki.alias.php"
+       },
+       "AutoloadClasses": {
+               "Specialupdatemediawiki": "specialupdatemediawiki.php"
+       },
+       "manifest_version": 1
+}
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I70141958c40d6269f7a828b31047fd20b9bfc5ed
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/UpdateMediaWiki
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek <matejsuchane...@gmail.com>
Gerrit-Reviewer: Miguel2706 <miguel2...@outlook.com>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
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