[MediaWiki-commits] [Gerrit] mediawiki...SimpleChanges[master]: Convert SimpleChanges to use extension registration
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/374964 ) Change subject: Convert SimpleChanges to use extension registration .. Convert SimpleChanges to use extension registration Bug: T174661 Change-Id: Ifbeacb8044b0ec1e4fe37e4c447d1cfb5bcbcadc --- M SimpleChanges.php A extension.json 2 files changed, 51 insertions(+), 30 deletions(-) Approvals: Mainframe98: Looks good to me, but someone else must approve jenkins-bot: Verified tosfos: Looks good to me, approved diff --git a/SimpleChanges.php b/SimpleChanges.php index 9ccde1a..b78309b 100644 --- a/SimpleChanges.php +++ b/SimpleChanges.php @@ -3,7 +3,7 @@ * SimpleChanges - Special page that displays a barebones Recent Changes list * * To activate this extension, add the following into your LocalSettings.php file: - * require_once "$IP/extensions/SimpleChanges/SimpleChanges.php"; + * wfLoadExtension( 'SimpleChanges' ); * * @ingroup Extensions * @author Ike Hecht @@ -11,32 +11,13 @@ * @link https://www.mediawiki.org/wiki/Extension:SimpleChanges Documentation * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ -if ( !defined( 'MEDIAWIKI' ) ) { - echo( "This is an extension to the MediaWiki package and cannot be run standalone.\n" ); - die( -1 ); -} - -// Extension credits that will show up on Special:Version -$wgExtensionCredits['specialpage'][] = array( - 'path' => __FILE__, - 'name' => 'SimpleChanges', - 'version' => '1.1', - 'author' => 'Ike Hecht for [http://www.wikiworks.com/ WikiWorks]', - 'url' => 'https://www.mediawiki.org/wiki/Extension:SimpleChanges', - 'descriptionmsg' => 'simplechanges-desc', -); - -$wgAutoloadClasses['SpecialSimpleChanges'] = __DIR__ . '/SpecialSimpleChanges.php'; -$wgSpecialPages['SimpleChanges'] = 'SpecialSimpleChanges'; -$wgExtensionMessagesFiles['SimpleChanges'] = __DIR__ . '/SimpleChanges.i18n.php'; -$wgMessagesDirs['SimpleChanges'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['SimpleChangesAlias'] = __DIR__ . '/SimpleChanges.alias.php'; - -# Restrict list of changes to $wgContentNamespaces? -$wgSimpleChangesOnlyContentNamespaces = false; - -# Show only the changes which are each page's most recent revisions. Avoids duplicate page titles. -$wgSimpleChangesOnlyLatest = true; - -# Show the user who made the change -$wgSimpleChangesShowUser = false; +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'SimpleChanges' ); + wfWarn( + 'Deprecated PHP entry point used for SimpleChanges extension. ' . + 'Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + ); +} else { + die( 'This version of the SimpleChanges extension requires MediaWiki 1.29+' ); +} \ No newline at end of file diff --git a/extension.json b/extension.json new file mode 100644 index 000..7efb951 --- /dev/null +++ b/extension.json @@ -0,0 +1,40 @@ +{ + "name": "SimpleChanges", + "version": "1.1", + "author": [ + "[https://www.mediawiki.org/wiki/User:Tosfos Ike Hecht]" + ], + "type": "specialpage", + "url": "https://www.mediawiki.org/wiki/Extension:SimpleChanges;, + "descriptionmsg": "simplechanges-desc", + "license-name": "GPL-2.0+", + "AutoloadClasses": { + "SpecialSimpleChanges": "SpecialSimpleChanges.php" + }, + "MessagesDirs": { + "SimpleChanges": [ + "i18n" + ] + }, + "ExtensionMessagesFiles": { + "SimpleChangesAlias": "SimpleChanges.alias.php" + }, + "SpecialPages": { + "SimpleChanges": "SpecialSimpleChanges" + }, + "config": { + "SimpleChangesOnlyContentNamespaces": { + "value": false, + "description": "Restrict list of changes to $wgContentNamespaces?" + }, + "SimpleChangesOnlyLatest": { + "value": true, + "description": "Show only the changes which are each page's most recent revisions. Avoids duplicate page titles." + }, + "SimpleChangesShowUser": { + "value": false, + "description": "Show the user who made the change." + } + }, + "manifest_version": 2 +} -- To view, visit https://gerrit.wikimedia.org/r/374964 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifbeacb8044b0ec1e4fe37e4c447d1cfb5bcbcadc Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/SimpleChanges Gerrit-Branch: master Gerrit-Owner: Reception123Gerrit-Reviewer: Mainframe98
[MediaWiki-commits] [Gerrit] mediawiki...SimpleChanges[master]: Convert SimpleChanges to use extension registration
Reception123 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/374964 ) Change subject: Convert SimpleChanges to use extension registration .. Convert SimpleChanges to use extension registration Bug: T174661 Change-Id: Ifbeacb8044b0ec1e4fe37e4c447d1cfb5bcbcadc --- M SimpleChanges.php A extension.json 2 files changed, 51 insertions(+), 29 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SimpleChanges refs/changes/64/374964/1 diff --git a/SimpleChanges.php b/SimpleChanges.php index 9ccde1a..eeaa573 100644 --- a/SimpleChanges.php +++ b/SimpleChanges.php @@ -11,32 +11,13 @@ * @link https://www.mediawiki.org/wiki/Extension:SimpleChanges Documentation * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ -if ( !defined( 'MEDIAWIKI' ) ) { - echo( "This is an extension to the MediaWiki package and cannot be run standalone.\n" ); - die( -1 ); -} - -// Extension credits that will show up on Special:Version -$wgExtensionCredits['specialpage'][] = array( - 'path' => __FILE__, - 'name' => 'SimpleChanges', - 'version' => '1.1', - 'author' => 'Ike Hecht for [http://www.wikiworks.com/ WikiWorks]', - 'url' => 'https://www.mediawiki.org/wiki/Extension:SimpleChanges', - 'descriptionmsg' => 'simplechanges-desc', -); - -$wgAutoloadClasses['SpecialSimpleChanges'] = __DIR__ . '/SpecialSimpleChanges.php'; -$wgSpecialPages['SimpleChanges'] = 'SpecialSimpleChanges'; -$wgExtensionMessagesFiles['SimpleChanges'] = __DIR__ . '/SimpleChanges.i18n.php'; -$wgMessagesDirs['SimpleChanges'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['SimpleChangesAlias'] = __DIR__ . '/SimpleChanges.alias.php'; - -# Restrict list of changes to $wgContentNamespaces? -$wgSimpleChangesOnlyContentNamespaces = false; - -# Show only the changes which are each page's most recent revisions. Avoids duplicate page titles. -$wgSimpleChangesOnlyLatest = true; - -# Show the user who made the change -$wgSimpleChangesShowUser = false; +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'SimpleChanges' ); + wfWarn( + 'Deprecated PHP entry point used for SimpleChanges extension. ' . + 'Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + ); +} else { + die( 'This version of the SimpleChanges extension requires MediaWiki 1.29+' ); +} \ No newline at end of file diff --git a/extension.json b/extension.json new file mode 100644 index 000..4b38153 --- /dev/null +++ b/extension.json @@ -0,0 +1,41 @@ +{ + "name": "SimpleChanges", + "version": "1.1", + "author": [ + "[https://www.mediawiki.org/wiki/User:Tosfos Ike Hecht]" + ], + "type": "specialpage", + "url": "https://www.mediawiki.org/wiki/Extension:SimpleChanges;, + "descriptionmsg": "simplechanges-desc", + "license-name": "GPL-2.0+", + "AutoloadClasses": { + "SpecialSimpleChanges": "SpecialSimpleChanges.php" + }, + "MessagesDirs": { + "SimpleChanges": [ + "i18n" + ] + }, + "ExtensionMessagesFiles": { + "SimpleChanges": "SimpleChanges.i18n.php", + "SimpleChangesAlias": "SimpleChanges.i18n.php" + }, + "SpecialPages": { + "SimpleChanges": "SpecialSimpleChanges" + }, + "config": { + "SimpleChangesOnlyContentNamespaces": { + "value": false, + "description": "Restrict list of changes to $wgContentNamespaces?" + }, + "SimpleChangesOnlyLatest": { + "value": true, + "description": "Show only the changes which are each page's most recent revisions. Avoids duplicate page titles." + }, + "SimpleChangesShowUser": { + "value": false, + "description": "Show the user who made the change." + } + }, + "manifest_version": 2 +} -- To view, visit https://gerrit.wikimedia.org/r/374964 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifbeacb8044b0ec1e4fe37e4c447d1cfb5bcbcadc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SimpleChanges Gerrit-Branch: master Gerrit-Owner: Reception123___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits