diff --git a/README b/README index 50d81dc0..790f7e96 100644 --- a/README +++ b/README @@ -32,12 +32,11 @@ This version of the Replace Text extension requires MediaWiki 1.23 or higher. == Installation == -To install the extension, place the entire 'ReplaceText' directory -within your MediaWiki 'extensions' directory, then add either of the -following lines to your 'LocalSettings.php' file: +To install the extension, place the entire 'ReplaceText' directory within +your MediaWiki 'extensions' directory, then add the following line to your +'LocalSettings.php' file: wfLoadExtension( 'ReplaceText' ); - require_once( "$IP/extensions/ReplaceText/ReplaceText.php" ); In order to perform replacements, you must have the 'replacetext' permssion; if you are an administrator on your wiki, the easiest way to do this is to diff --git a/ReplaceText.php b/ReplaceText.php index 404b594a..2fa5eb02 100644 --- a/ReplaceText.php +++ b/ReplaceText.php @@ -1,73 +1,11 @@ __FILE__, - 'name' => 'Replace Text', - 'version' => REPLACE_TEXT_VERSION, - 'author' => [ 'Yaron Koren', 'Niklas Laxström', '...' ], - 'url' => 'https://www.mediawiki.org/wiki/Extension:Replace_Text', - 'descriptionmsg' => 'replacetext-desc', - 'license-name' => 'GPL-2.0-or-later' -]; +wfLoadExtension( 'ReplaceText' ); +// Keep i18n globals so mergeMessageFileList.php doesn't break $wgMessagesDirs['ReplaceText'] = __DIR__ . '/i18n'; $wgExtensionMessagesFiles['ReplaceTextAlias'] = __DIR__ . '/ReplaceText.i18n.alias.php'; -$wgJobClasses['replaceText'] = 'ReplaceTextJob'; - -// This extension uses its own permission type, 'replacetext' -$wgAvailableRights[] = 'replacetext'; -$wgGroupPermissions['sysop']['replacetext'] = true; - -$wgHooks['AdminLinks'][] = 'ReplaceTextHooks::addToAdminLinks'; - -$wgSpecialPages['ReplaceText'] = 'SpecialReplaceText'; -$wgAutoloadClasses['ReplaceTextHooks'] = __DIR__ . '/src/ReplaceTextHooks.php'; -$wgAutoloadClasses['SpecialReplaceText'] = __DIR__ . '/src/SpecialReplaceText.php'; -$wgAutoloadClasses['ReplaceTextJob'] = __DIR__ . '/src/ReplaceTextJob.php'; -$wgAutoloadClasses['ReplaceTextSearch'] = __DIR__ . '/src/ReplaceTextSearch.php'; - -$wgResourceModules['ext.ReplaceText'] = [ - 'scripts' => 'ext.ReplaceText.js', - 'localBasePath' => 'resources', - 'remoteExtPath' => 'ReplaceText/resources', -]; - -// Global variables -$wgReplaceTextUser = null; +wfWarn( + 'Deprecated PHP entry point used for Replace Text extension. ' . + 'Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' +);