Ingomueller-net has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/250012

Change subject: Add rudimentary support to install UserMerge with composer.
......................................................................

Add rudimentary support to install UserMerge with composer.

Adding name, type, and autoloader to composer.json, as well as using
globals explicitely when registering the extension were enough to
make it work. It might be a good idea to add description, licence,
etc to composer.json as well.

Basic documentation on the topic:
* https://www.mediawiki.org/wiki/Composer/For_extensions
* 
http://www.bn2vs.com/blog/2013/11/24/introduction-to-composer-for-mediawiki-developers/
* https://getcomposer.org/doc/02-libraries.md

The final goal of this change is to publish UserMerge on
packagist.org so that it found by composer automatically.

Change-Id: Icb085627d2c0ac5b51ac4edd5ce2cef80876de02
---
M UserMerge.php
M composer.json
M install.settings
3 files changed, 12 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UserMerge 
refs/changes/12/250012/1

diff --git a/UserMerge.php b/UserMerge.php
index 120aa80..beddb78 100644
--- a/UserMerge.php
+++ b/UserMerge.php
@@ -2,8 +2,8 @@
 if ( function_exists( 'wfLoadExtension' ) ) {
        wfLoadExtension( 'UserMerge' );
        // Keep i18n globals so mergeMessageFileList.php doesn't break
-       $wgMessagesDirs['UserMerge'] = __DIR__ . '/i18n';
-       $wgExtensionMessagesFiles['UserMergeAlias'] = __DIR__ . 
'/UserMerge.alias.php';
+       $GLOBALS['wgMessagesDirs']['UserMerge'] = __DIR__ . '/i18n';
+       $GLOBALS['wgExtensionMessagesFiles']['UserMergeAlias'] = __DIR__ . 
'/UserMerge.alias.php';
        /* wfWarn(
                'Deprecated PHP entry point used for UserMerge extension. 
Please use wfLoadExtension instead, ' .
                'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
diff --git a/composer.json b/composer.json
index 99741dd..52a8e15 100644
--- a/composer.json
+++ b/composer.json
@@ -1,4 +1,13 @@
 {
+       "name": "mediawiki/user-merge",
+       "description": "Merges references from one user to another user in the 
wiki database",
+       "type": "mediawiki-extension",
+       "autoload": {
+               "files": ["UserMerge.php"]
+       },
+       "require": {
+               "composer/installers": ">1.0.12"
+       },
        "require-dev": {
                "jakub-onderka/php-parallel-lint": "0.9",
                "mediawiki/mediawiki-codesniffer": "0.5.0"
diff --git a/install.settings b/install.settings
index 9d9bac5..a0bea8a 100644
--- a/install.settings
+++ b/install.settings
@@ -1,4 +1,4 @@
 require_once( "$IP/extensions/UserMerge/UserMerge.php" );
 # Assign the usermerge right to a usergroup, i.e. to the bureaucrats:
-$wgGroupPermissions['bureaucrat']['usermerge'] = true;
+$GLOBALS['wgGroupPermissions']['bureaucrat']['usermerge'] = true;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb085627d2c0ac5b51ac4edd5ce2cef80876de02
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UserMerge
Gerrit-Branch: master
Gerrit-Owner: Ingomueller-net <[email protected]>

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

Reply via email to