Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Numinix MediaWiki Demo
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Manual/Extensions
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Installing an extension == <!--T:25--> </translate> : ''<translate><!--T:131--> For further guidance, see also <tvar name=1></tvar></translate>'' <translate><!--T:26--> MediaWiki is ready to accept extensions just after [[<tvar name=man>Special:MyLanguage/Manual:Installation</tvar>|installation]] is finished.</translate> <translate><!--T:27--> To add an extension follow these steps:</translate> # '''<translate><!--T:28--> Before you start</translate>''' #: <translate><!--T:29--> Many extensions provide instructions designed for installation using Unix commands.</translate> <translate><!--T:30--> You require shell access (SSH) to enter these commands listed on the extension help pages.</translate> # '''<translate><!--T:31--> Download your extension</translate>''' #: <translate><!--T:32--> [[<tvar name=special>Special:ExtensionDistributor</tvar>|Extension Distributor]] helps you to select and download most of the popular extensions.</translate> #: <translate><!--T:33--> Extensions are usually distributed as modular packages.</translate> <translate><!--T:34--> They generally go in their own subdirectory of <tvar name=IP><code>/extensions/</code></tvar>.</translate> <translate><!--T:35--> A list of extensions stored in the Wikimedia [[<tvar name=gerrit>Special:MyLanguage/Gerrit</tvar>|Git repository]] is located at <tvar name=extensions>[[phab:diffusion/MEXT/browse/master/|git:mediawiki/extensions]]</tvar>.</translate> <translate><!--T:36--> Some extensions [[<tvar name=cat>Special:MyLanguage/Category:Extensions which host their code in-wiki</tvar>|don't use version control]] and are not recommended.</translate> #: <translate><!--T:37--> Some extensions are also available in [[<tvar name=1>Special:MyLanguage/Software bundles</tvar>|bundles]], <tvar name=composer></tvar> or [[<tvar name=2>Special:MyLanguage/Comparison of extensions in distributions</tvar>|package repositories]].</translate> #: <translate><!--T:127--> It's recommended to read the <tvar name=1>README</tvar> file before installation.</translate> <translate><!--T:128--> It usually contains important info about configuration.</translate> # '''<translate><!--T:38--> Install your extension</translate>''' #: <translate><!--T:39--> At the end of the <tvar name=LocalSettings><code></code></tvar> file, add:</translate> #: <syntaxhighlight lang="php"> wfLoadExtension( 'ExtensionName' ); </syntaxhighlight> #: <translate><!--T:40--> This line forces the PHP interpreter to read the extension file, and thereby make it accessible to MediaWiki.</translate> #: <translate><!--T:41--> Some extensions can conflict with maintenance scripts, for example if they directly access <tvar name=1><code>$_SERVER</code></tvar> (not recommended).</translate> <translate><!--T:42--> In this case, they can be wrapped in the conditional so maintenance scripts can still run.</translate> #: <syntaxhighlight lang="php"> if ( !$wgCommandLineMode ) { wfLoadExtension ( 'ExtensionName' ); } </syntaxhighlight> #: <translate><!--T:43--> The maintenance script <tvar name=ImportDump></tvar> will fail for any extension which requires customised namespaces which is ''included'' inside the conditional above such as <tvar name=1></tvar>, <tvar name=2></tvar>.</translate> : : {{Note|1=<translate><!--T:45--> While this installation procedure is sufficient for most extensions, some require a different installation procedure.</translate> <translate><!--T:46--> Check your extension's documentation for details.</translate>}} : {{Note|1=<translate><!--T:47--> If you want to alter configuration variables in <tvar name=1><code>LocalSettings.php</code></tvar>, you have to do this typically '''after''' including the extension.</translate> <translate><!--T:48--> Otherwise defaults defined in the extension will overwrite your settings.</translate>}} <translate> === Upgrading an extension === <!--T:51--> </translate> <translate><!--T:52--> Some extensions require to be updated whenever you update MediaWiki, while others work with multiple versions.</translate> <translate><!--T:53--> To upgrade to a new version of an extension:</translate> # <translate><!--T:54--> Download the new version of the extension</translate> # <translate><!--T:55--> Replace all the extension files in the <tvar name=1><code>extensions/ExtensionName</code></tvar> directory with the new files.</translate> <translate><!--T:56--> Do not remove the extension configuration present in <tvar name=1><code>LocalSettings.php</code></tvar></translate> # <translate><!--T:57--> If the extension requires changes to the MediaWiki database, you will need to run the <tvar name=1></tvar> maintenance script.</translate> <translate><!--T:58--> Most extensions will mention if this script needs to be run or not.</translate> <translate><!--T:83--> (Perform backup of your data before executing the script).</translate> <translate><!--T:60--> If you don't have command line access, you can also use the [[<tvar name=man>Special:MyLanguage/Manual:Upgrading#Web_updater</tvar>|web updater]].</translate> {{Note|1=<translate><!--T:63--> These instructions cover 99% of extensions.</translate> <translate><!--T:64--> If the specific extension you are upgrading has instructions that differ from these, you should probably follow the specific extension's instructions</translate>}} <translate> === Uninstalling an extension === <!--T:65--> <!--T:86--> Remove the line from <tvar name=1><code>LocalSettings.php</code></tvar> with the extension name to uninstall it: </translate> <syntaxhighlight lang="php"> wfLoadExtension( 'ExtensionName' ); </syntaxhighlight> <translate> <!--T:87--> * You must also remove any lines pertaining to the configuration of the extension.
Summary:
Please note that all contributions to Numinix MediaWiki Demo may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)