Ingomueller-net has uploaded a new change for review. https://gerrit.wikimedia.org/r/250146
Change subject: Add rudimentary support to install intersection with composer. ...................................................................... Add rudimentary support to install intersection 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 intersection on packagist.org so that it found by composer automatically. Change-Id: I3a837a04b7feeb9adeab090c712942d04f92c35b --- M DynamicPageList.php A composer.json 2 files changed, 21 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/intersection refs/changes/46/250146/1 diff --git a/DynamicPageList.php b/DynamicPageList.php index d88569e..cdb8d3a 100644 --- a/DynamicPageList.php +++ b/DynamicPageList.php @@ -38,7 +38,7 @@ } // Extension credits that will show up on Special:Version -$wgExtensionCredits['parserhook'][] = array( +$_GLOBALS['wgExtensionCredits']['parserhook'][] = array( 'path' => __FILE__, 'name' => 'DynamicPageList', 'version' => '1.7.0', @@ -48,25 +48,25 @@ ); // Internationalization file -$wgMessagesDirs['DynamicPageList'] = __DIR__ . '/i18n'; +$_GLOBALS['wgMessagesDirs']['DynamicPageList'] = __DIR__ . '/i18n'; -$wgAutoloadClasses['DynamicPageListHooks'] = __DIR__ . '/DynamicPageList.hooks.php'; +$_GLOBALS['wgAutoloadClasses']['DynamicPageListHooks'] = __DIR__ . '/DynamicPageList.hooks.php'; // Parser tests // Warning, these only work when run with parserTests.php. There will be // failures if run via phpunit! (you may want to comment the below line // out if you're regularly running phpunit tests) -$wgParserTestFiles[] = __DIR__ . '/DynamicPageList.tests.txt'; +$_GLOBALS['wgParserTestFiles'][] = __DIR__ . '/DynamicPageList.tests.txt'; # Configuration variables. Warning: These use DLP instead of DPL # for historical reasons (pretend Dynamic list of pages) -$wgDLPmaxCategories = 6; // Maximum number of categories to look for -$wgDLPMaxResultCount = 200; // Maximum number of results to allow -$wgDLPAllowUnlimitedResults = false; // Allow unlimited results -$wgDLPAllowUnlimitedCategories = false; // Allow unlimited categories +$_GLOBALS['wgDLPmaxCategories'] = 6; // Maximum number of categories to look for +$_GLOBALS['wgDLPMaxResultCount'] = 200; // Maximum number of results to allow +$_GLOBALS['wgDLPAllowUnlimitedResults'] = false; // Allow unlimited results +$_GLOBALS['wgDLPAllowUnlimitedCategories'] = false; // Allow unlimited categories // How long to cache pages using DPL's in seconds. Default to 1 day. Set to // false to not decrease cache time (most efficient), Set to 0 to disable // cache altogether (inefficient, but results will never be outdated) -$wgDLPMaxCacheTime = 60*60*24; // How long to cache pages +$_GLOBALS['wgDLPMaxCacheTime'] = 60*60*24; // How long to cache pages -$wgHooks['ParserFirstCallInit'][] = 'DynamicPageListHooks::onParserFirstCallInit'; +$_GLOBALS['wgHooks']['ParserFirstCallInit'][] = 'DynamicPageListHooks::onParserFirstCallInit'; diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..49ed0ad --- /dev/null +++ b/composer.json @@ -0,0 +1,11 @@ +{ + "name": "mediawiki/intersection", + "description": "Outputs a bulleted list of the most recent items residing in a category, or an intersection of several categories", + "type": "mediawiki-extension", + "autoload": { + "files": ["intersection.php"] + }, + "require": { + "composer/installers": ">1.0.12" + } +} -- To view, visit https://gerrit.wikimedia.org/r/250146 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3a837a04b7feeb9adeab090c712942d04f92c35b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/intersection Gerrit-Branch: master Gerrit-Owner: Ingomueller-net <wikimedia....@ingomueller.net> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits