Ingomueller-net has uploaded a new change for review.

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

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

Add rudimentary support to install ParserFunctions 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 ParserFunctions on
packagist.org so that it found by composer automatically.

Change-Id: I50a491b748ebf481519a7355db73d4e4923e8bf9
---
M ParserFunctions.php
A composer.json
2 files changed, 13 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ParserFunctions 
refs/changes/19/250019/1

diff --git a/ParserFunctions.php b/ParserFunctions.php
index c38db82..311e0ba 100644
--- a/ParserFunctions.php
+++ b/ParserFunctions.php
@@ -3,8 +3,8 @@
 if ( function_exists( 'wfLoadExtension' ) ) {
        wfLoadExtension( 'ParserFunctions' );
        // Keep i18n globals so mergeMessageFileList.php doesn't break
-       $wgMessagesDirs['ParserFunctions'] = __DIR__ . '/i18n';
-       $wgExtensionMessagesFiles['ParserFunctionsMagic'] = __DIR__ . 
'/ParserFunctions.i18n.magic.php';
+       $GLOBALS_['wgMessagesDirs']['ParserFunctions'] = __DIR__ . '/i18n';
+       $GLOBALS_['wgExtensionMessagesFiles']['ParserFunctionsMagic'] = __DIR__ 
. '/ParserFunctions.i18n.magic.php';
        /* wfWarn(
                'Deprecated PHP entry point used for ParserFunctions extension. 
Please use wfLoadExtension instead, ' .
                'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..994ea20
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,11 @@
+{
+       "name": "mediawiki/parser-functions",
+        "description": "Enhance parser with logical functions",
+       "type": "mediawiki-extension",
+       "autoload": {
+               "files": ["ParserFunctions.php"]
+       },
+       "require": {
+               "composer/installers": ">1.0.12"
+       }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I50a491b748ebf481519a7355db73d4e4923e8bf9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ParserFunctions
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