diff options
Diffstat (limited to 'extensions/Nuke/Nuke.php')
-rw-r--r-- | extensions/Nuke/Nuke.php | 57 |
1 files changed, 12 insertions, 45 deletions
diff --git a/extensions/Nuke/Nuke.php b/extensions/Nuke/Nuke.php index 12022f28..ec37f1c5 100644 --- a/extensions/Nuke/Nuke.php +++ b/extensions/Nuke/Nuke.php @@ -1,48 +1,15 @@ <?php -if ( !defined( 'MEDIAWIKI' ) ) { - die( 'Not an entry point.' ); +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'Nuke' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['Nuke'] = __DIR__ . '/i18n'; + $wgExtensionMessagesFiles['NukeAlias'] = __DIR__ . '/Nuke.alias.php'; + /* wfWarn( + 'Deprecated PHP entry point used for Nuke extension. Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + ); */ + return true; +} else { + die( 'This version of the Nuke extension requires MediaWiki 1.25+' ); } - -define( 'Nuke_VERSION', '1.2.0' ); - -$dir = dirname( __FILE__ ) . '/'; - -$wgMessagesDirs['Nuke'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['Nuke'] = $dir . 'Nuke.i18n.php'; -$wgExtensionMessagesFiles['NukeAlias'] = $dir . 'Nuke.alias.php'; - -$wgExtensionCredits['specialpage'][] = array( - 'path' => __FILE__, - 'name' => 'Nuke', - 'descriptionmsg' => 'nuke-desc', - 'author' => array( 'Brion Vibber', 'Jeroen De Dauw' ), - 'url' => 'https://www.mediawiki.org/wiki/Extension:Nuke', - 'version' => Nuke_VERSION, -); - -$wgGroupPermissions['sysop']['nuke'] = true; -$wgAvailableRights[] = 'nuke'; - -$wgAutoloadClasses['SpecialNuke'] = $dir . 'Nuke_body.php'; -$wgAutoloadClasses['NukeHooks'] = $dir . 'Nuke.hooks.php'; -$wgSpecialPages['Nuke'] = 'SpecialNuke'; -$wgSpecialPageGroups['Nuke'] = 'pagetools'; - -$wgHooks['ContributionsToolLinks'][] = 'NukeHooks::nukeContributionsLinks'; - -// Resource loader modules -$moduleTemplate = array( - 'localBasePath' => dirname( __FILE__ ) . '/', - 'remoteExtPath' => 'Nuke/' -); - -$wgResourceModules['ext.nuke'] = $moduleTemplate + array( - 'scripts' => array( - 'ext.nuke.js' - ), - 'messages' => array( - ) -); - -unset( $moduleTemplate ); |