Ingomueller-net has uploaded a new change for review. https://gerrit.wikimedia.org/r/249867
Change subject: Add rudimentary support to install LastUserLogin with composer. ...................................................................... Add rudimentary support to install LastUserLogin 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 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 LastUserLogin on packagist.org so that it found by composer automatically. Change-Id: I4d079eddad418ef2fda4f20fc95d5f1c575eae62 --- M LastUserLogin.php A composer.json 2 files changed, 16 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LastUserLogin refs/changes/67/249867/1 diff --git a/LastUserLogin.php b/LastUserLogin.php index 8f5567d..4a73414 100644 --- a/LastUserLogin.php +++ b/LastUserLogin.php @@ -18,7 +18,7 @@ * @file */ -$wgExtensionCredits['specialpage'][] = array( +$GLOBALS['wgExtensionCredits']['specialpage'][] = array( 'path' => __FILE__, 'name' => 'LastUserLogin', 'version' => '1.3', @@ -27,16 +27,16 @@ 'descriptionmsg' => 'lastuserlogin-desc', ); -$wgAutoloadClasses['LastUserLogin'] = __DIR__ . '/LastUserLogin.body.php'; -$wgExtensionMessagesFiles['LastUserLogin'] = __DIR__ . '/LastUserLogin.i18n.php'; -$wgExtensionMessagesFiles['LastUserLoginAlias'] = __DIR__ . '/LastUserLogin.alias.php'; +$GLOBALS['wgAutoloadClasses']['LastUserLogin'] = __DIR__ . '/LastUserLogin.body.php'; +$GLOBALS['wgExtensionMessagesFiles']['LastUserLogin'] = __DIR__ . '/LastUserLogin.i18n.php'; +$GLOBALS['wgExtensionMessagesFiles']['LastUserLoginAlias'] = __DIR__ . '/LastUserLogin.alias.php'; // New user right -$wgAvailableRights[] = 'lastlogin'; -$wgGroupPermissions['sysop']['lastlogin'] = true; +$GLOBALS['wgAvailableRights'][] = 'lastlogin'; +$GLOBALS['wgGroupPermissions']['sysop']['lastlogin'] = true; // Set up the new special page -$wgSpecialPages['LastUserLogin'] = 'LastUserLogin'; +$GLOBALS['wgSpecialPages']['LastUserLogin'] = 'LastUserLogin'; // Register the method that updates the database when a user logs in -$wgExtensionFunctions[] = 'LastUserLogin::updateUserTouched'; \ No newline at end of file +$GLOBALS['wgExtensionFunctions'][] = 'LastUserLogin::updateUserTouched'; diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..73d934a --- /dev/null +++ b/composer.json @@ -0,0 +1,8 @@ +{ + "name": "mediawiki/last-user-login", + "description": "Displays the last time a user logged in", + "type": "mediawiki-extension", + "autoload": { + "files": ["LastUserLogin.php"] + } +} -- To view, visit https://gerrit.wikimedia.org/r/249867 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4d079eddad418ef2fda4f20fc95d5f1c575eae62 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LastUserLogin Gerrit-Branch: master Gerrit-Owner: Ingomueller-net <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
