MediaWiki  1.34.0
ReplaceText.php
Go to the documentation of this file.
1 <?php
20 if ( function_exists( 'wfLoadExtension' ) ) {
21  wfLoadExtension( 'ReplaceText' );
22  // Keep i18n globals so mergeMessageFileList.php doesn't break
23  $wgMessagesDirs['ReplaceText'] = __DIR__ . '/i18n';
24  $wgExtensionMessagesFiles['ReplaceTextAlias'] = __DIR__ . '/ReplaceText.i18n.alias.php';
25  wfWarn(
26  'Deprecated PHP entry point used for Replace Text extension. ' .
27  'Please use wfLoadExtension instead, ' .
28  'see https://www.mediawiki.org/wiki/Extension_registration for more details.'
29  );
30  return;
31 }
32 
33 if ( !defined( 'MEDIAWIKI' ) ) {
34  die();
35 }
36 
37 define( 'REPLACE_TEXT_VERSION', '1.4.1' );
38 
39 // credits
40 $wgExtensionCredits['specialpage'][] = [
41  'path' => __FILE__,
42  'name' => 'Replace Text',
43  'version' => REPLACE_TEXT_VERSION,
44  'author' => [ 'Yaron Koren', 'Niklas Laxström', '...' ],
45  'url' => 'https://www.mediawiki.org/wiki/Extension:Replace_Text',
46  'descriptionmsg' => 'replacetext-desc',
47  'license-name' => 'GPL-2.0-or-later'
48 ];
49 
50 $wgMessagesDirs['ReplaceText'] = __DIR__ . '/i18n';
51 $wgExtensionMessagesFiles['ReplaceTextAlias'] = __DIR__ . '/ReplaceText.i18n.alias.php';
52 $wgJobClasses['replaceText'] = 'ReplaceTextJob';
53 
54 // This extension uses its own permission type, 'replacetext'
55 $wgAvailableRights[] = 'replacetext';
56 $wgGroupPermissions['sysop']['replacetext'] = true;
57 
58 $wgHooks['AdminLinks'][] = 'ReplaceTextHooks::addToAdminLinks';
59 
60 $wgSpecialPages['ReplaceText'] = 'SpecialReplaceText';
61 $wgAutoloadClasses['ReplaceTextHooks'] = __DIR__ . '/src/ReplaceTextHooks.php';
62 $wgAutoloadClasses['SpecialReplaceText'] = __DIR__ . '/src/SpecialReplaceText.php';
63 $wgAutoloadClasses['ReplaceTextJob'] = __DIR__ . '/src/ReplaceTextJob.php';
64 $wgAutoloadClasses['ReplaceTextSearch'] = __DIR__ . '/src/ReplaceTextSearch.php';
65 
66 $wgResourceModules['ext.ReplaceText'] = [
67  'scripts' => 'ext.ReplaceText.js',
68  'localBasePath' => 'resources',
69  'remoteExtPath' => 'ReplaceText/resources',
70 ];
71 
72 // Global variables
$wgExtensionCredits
$wgExtensionCredits['specialpage'][]
Definition: ReplaceText.php:40
$wgAutoloadClasses
$wgAutoloadClasses['ReplaceTextHooks']
Definition: ReplaceText.php:61
$wgHooks
$wgHooks['AdminLinks'][]
Definition: ReplaceText.php:58
$wgAvailableRights
$wgAvailableRights[]
Definition: ReplaceText.php:55
$wgJobClasses
$wgJobClasses['replaceText']
Definition: ReplaceText.php:52
$wgSpecialPages
$wgSpecialPages['ReplaceText']
Definition: ReplaceText.php:60
REPLACE_TEXT_VERSION
const REPLACE_TEXT_VERSION(!defined( 'MEDIAWIKI'))
Replace Text - a MediaWiki extension that provides a special page to allow administrators to do a glo...
Definition: ReplaceText.php:37
$wgMessagesDirs
$wgMessagesDirs['ReplaceText']
Definition: ReplaceText.php:50
wfLoadExtension
wfLoadExtension( $ext, $path=null)
Load an extension.
Definition: GlobalFunctions.php:47
$wgResourceModules
$wgResourceModules['ext.ReplaceText']
Definition: ReplaceText.php:66
wfWarn
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
Definition: GlobalFunctions.php:1065
$wgGroupPermissions
$wgGroupPermissions['sysop']['replacetext']
Definition: ReplaceText.php:56
$wgReplaceTextUser
$wgReplaceTextUser
Definition: ReplaceText.php:73
$wgExtensionMessagesFiles
$wgExtensionMessagesFiles['ReplaceTextAlias']
Definition: ReplaceText.php:51