Template:ExtensionInstall

From Linux Web Expert


  • Download and move the extracted ExtensionInstall folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ExtensionInstall
  • Add the following code at the bottom of your LocalSettings.php file:
    require_once "$IP/extensions/ExtensionInstall/ExtensionInstall.php";
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Template documentation

Usage

<templatedata> { "description": { "en": "Installation instructions.", "fr": "Instructions d'installation." }, "params": { "1": { "label": { "en": "Extension name", "cs": "Název rozšíření", "hu": "Kiterjesztés neve", "pl": "Nazwa rozszerzenia", "fr": "nom de l'extension" }, "description": { "en": "Set the extension name manually.", "cs": "Nastavit název rozšíření ručně.", "hu": "A kiterjesztés nevének beállítása kézzel", "pl": "Ręcznie ustawia nazwę rozszerzenia.", "fr": "définit manuellement le nom de l'extension" }, "default": { "en": "The current page name without namespace prefix.", "cs": "Název aktuální stránky bez předpony jmenného prostoru.", "pl": "Nazwa bieżącej strony bez przestrzeni nazw." }, "type": "string", "autovalue": "ExtensionInstall", "example": { "fr": "nom actuel de la page sans le préfixe de l'espace de noms" } }, "vagrant": { "label": { "en": "Vagrant role name", "cs": "Název úlohy Vagrant", "hu": "Vagrant-szerepnév", "pl": "Nazwa roli w Vagrancie", "fr": "nom du rôle Vagrant" }, "description": { "en": "If given, shows how to install extension with the Vagrant's enable-role command", "cs": "Pokud je uvedeno, ukazuje, jak nainstalovat rozšíření pomocí příkazu povolení úlohy Vagrant", "pl": "Jeśli podano, pokazuje jak zainstalować rozszerzenie za pomocą komendy Vagranta „roles enable”.", "fr": "s'il est mentionné, il indique comment installer l'extension avec la commande Vagrant's enable-role" }, "type": "string" }, "download-link": { "label": { "en": "Download link", "cs": "Odkaz ke stažení", "hu": "Letöltési hivatkozás", "pl": "Link do pobierania", "fr": "lien de téléchargement" }, "description": { "en": "Overwrite the download link.", "cs": "Přepíše odkaz ke stažení.", "hu": "A letöltési hivatkozás felülírása", "pl": "Zastępuje domyślny link do pobierania rozszerzenia.", "fr": "redéfinit le lien de téléchargement " }, "default": { "en": "Link to Special:ExtensionDistributor with the extension name.", "cs": "Odkaz na Special:ExtensionDistributor s názvem rozšíření.", "pl": "Link do Special:ExtensionDistributor z dodaną nazwą rozszerzenia.", "fr": "lien vers le Special:ExtensionDistributor avec le nom de l'extension" }, "type": "url" }, "localsettingsearly": { "label": { "en": "LocalSettings early", "fr": "LocalSettings au préchargement" }, "description": { "en": "Pass custom php code that the user should include in LocalSettings.php before the extension is loaded.", "cs": "Předá vlastní php kód, který by měl uživatel zahrnout do LocalSettings.php před načtením rozšíření.", "pl": "Kod PHP, który użytkownik powinien dołączyć do pliku LocalSettings.php, a który ma być wykonany przed załadowaniem rozszerzenia.", "fr": "Passe le code php personnalisé que l'utilisateur doit inclure dans LocalSettings.php avant que l'extension ne soit chargée." }, "example": { "en": "$wgUseAjax = true; //must be included before the extension is loaded", "fr": "$wgUseAjax = true; //doit être inclus avant que l'extension soit chargée" } }, "localsettings": { "label": { "en": "LocalSettings", "fr": "localsettings" }, "description": { "en": "Pass custom php code that the user should include in LocalSettings.php.", "cs": "Předá vlastní php kód, který by měl uživatel zahrnout do LocalSettings.php.", "hu": "Egyéni PHP-kód, amit a felhasználónak el kell helyeznie a LocalSettings.php-ban", "pl": "Kod PHP, który użytkownik powinien dołączyć do pliku LocalSettings.php.", "fr": "Passe le code php personnalisé que l'utilisateur doit inclure dans LocalSettings.php." }, "example": { "en": "$wgUseAjax = true;", "fr": "$wgUseAjax = true;" } }, "db-update": { "label": { "en": "Database update", "cs": "Aktualizace databáze", "hu": "Adatbázis-frissítés", "pl": "Aktualizacja bazy danych", "fr": "mise à jour de la base de données" }, "description": { "en": "If the extension has one or more database tables that need to be created through update.php, set this parameter to any value.", "cs": "Pokud má rozšíření jednu nebo více databázových tabulek, které je třeba vytvořit prostřednictvím update.php, nastavte tento parametr na libovolnou hodnotu.", "hu": "Ha a kiterjesztésnek van egy vagy több adatbázistáblája, amiket létre kell hozni az update.php segítségével, állítsd ezt a paramétert bármilyen értékre.", "pl": "Należy nadać temu parametrowi dowolną wartość, jeśli rozszerzenie wymaga utworzenia co najmniej jednej tabeli w bazie danych za pomocą skryptu update.php.", "fr": "Si l'extension possède une ou plusieurs tables de base de données qui doivent être créées via update.php, initialisez ce paramètre à n'importe quelle valeur." }, "type": "boolean", "default": "false" }, "composer": { "label": { "en": "Composer", "fr": "composer" }, "description": { "en": "If the extension uses Composer to manage dependencies, set this parameter to any value.", "cs": "Pokud rozšíření používá ke správě závislostí Composer, nastavte tento parametr na libovolnou hodnotu.", "hu": "Ha a kiterjesztés a Composert használja a függőségek kezelésére, állítsd ezt a paramétert bármilyen értékre.", "pl": "Należy nadać temu parametrowi dowolną wartość, jeśli rozszerzenie wykorzystuje Composera do zarządzania zależnościami.", "fr": "Si l'extension utilise Composer pour gérer les dépendances, initialisez ce paramètre avec n'importe quelle valeur." }, "type": "boolean", "default": "false" }, "custom-steps0": { "label": { "en": "Custom steps 0", "cs": "Vlastní kroky 0", "hu": "Egyéni lépések 0", "pl": "Niestandardowe kroki 0", "fr": "étapes personnalisées de niveau 0" }, "description": { "en": "Additional steps before download, e.g. other required extensions (as an unordered \"* list\")", "cs": "Další kroky před stažením, např. další požadovaná rozšíření (jako neuspořádaný \"* seznam\")", "hu": "A letöltés előtt szükséges további lépések, pl. szükséges más kiterjesztések (rendezetlen „* listaként”)", "pl": "Dodatkowe kroki do wykonania przed pobraniem, np. wymagane inne rozszerzenia (jako nieuporządkowana „* lista”).", "fr": "étapes supplémentaires avant le téléchargement, par exemple les autres extensions nécessaires (en tant que \"* list\" non ordonnée)" }, "type": "content" }, "custom-steps": { "label": { "en": "Custom steps", "cs": "Vlastní kroky", "hu": "Egyéni lépések", "pl": "Niestandardowe kroki", "fr": "étapes personnalisées" }, "description": { "en": "Additional steps (as an unordered \"* list\")", "cs": "Další kroky (jako neuspořádaný \"* seznam\")", "hu": "További lépések (rendezetlen „* listaként”)", "pl": "Dodatkowe kroki do wykonania (jako nieuporządkowana „* lista”).", "fr": "étapes supplémentaires (comme \"* list\" non ordonnée)" }, "type": "content" }, "registration": { "label": { "en": "Supports registration", "cs": "Podporuje registraci", "pl": "Wsparcie dla rejestracji", "fr": "enregistrement autorisé" }, "description": { "en": "Changes the template to use wfLoadExtension() if it supports registration. Set to any value if the extension supports registration, or to required if it only supports registration and doesn't support the old-style of loading.", "cs": "Změní šablonu tak, aby používala wfLoadExtension(), pokud podporuje registraci. Nastavte na libovolnou hodnotu, pokud rozšíření podporuje registraci, nebo na required (vyžadováno), pokud only (pouze) podporuje registraci a nepodporuje starý styl načítání.", "pl": "Należy nadać temu parametrowi dowolną wartość, jeśli rozszerzenie wspiera instalację poprzez rejestrację lub wartość „required”, jeśli rozszerzenie wspiera tylko ten sposób instalacji, a nie wspiera instalacji w starym stylu.", "fr": "modifie le modèle pour utiliser wfLoadExtension() si l'enregistrement est pris en charge. Mettre une valeur quelconque si l'extension prend en charge l'enregistrement, ou mettre required si on ne prend en charge uniquement que l'enregistrement et ne prend pas en charge l'ancien style de chargement." }, "type": "string" }, "no-registration-version": { "label": { "en": "No registration version", "cs": "Žádná registrovaná verze", "pl": "Wersja bez rejestracji", "fr": "version sans enregistrement" }, "description": { "en": "The MediaWiki version for which extension registration should not be used", "cs": "Verze MediaWiki, pro kterou by se neměla používat registrace rozšíření", "pl": "Wersja MediaWiki, w której nie należy instalować rozszerzenia poprzez rejestrację.", "fr": "version de MediaWiki pour laquelle l'enregistrement de l'extension ne doit pas être utilisé" }, "default": "1.24" }, "git-submodule": { "label": { "en": "Git submodule", "fr": "sous-module git" }, "description": { "en": "Add --recurse-submodules to the git clone command", "fr": "Ajouter --recurse-submodules à la commande git clone" }, "type": "boolean" } }, "format": "inline", "paramOrder": [ "1", "git-submodule", "vagrant", "download-link", "localsettingsearly", "localsettings", "db-update", "composer", "custom-steps0", "custom-steps", "registration", "no-registration-version" ] } </templatedata>

Examples

Below a few examples of how to use this template:

Simple

{{ExtensionInstall}}
  • <translate> [[<tvar name=2>Special:ExtensionDistributor/MyExtension</tvar>|Download]] and move the extracted <tvar name=name>MyExtension</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Name

{{ExtensionInstall|CategoryTree}}
  • <translate> [[<tvar name=2>Special:ExtensionDistributor/CategoryTree</tvar>|Download]] and move the extracted <tvar name=name>CategoryTree</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    require_once "$IP/extensions/CategoryTree/CategoryTree.php";
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Download link

{{ExtensionInstall
|download-link=[http://bits.wikimedia.org/example.zip Download]
}}
  • <translate> <tvar name=1>Download</tvar> and place the file(s) in a directory called <tvar name=name>MyExtension</tvar> in your <tvar name=ext>extensions/</tvar> folder.</translate>
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

LocalSettings

{{ExtensionInstall
|localsettings=
$wgUseAjax = true;
}}
  • <translate> [[<tvar name=2>Special:ExtensionDistributor/MyExtension</tvar>|Download]] and move the extracted <tvar name=name>MyExtension</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    $wgUseAjax = true;
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

LocalSettings early

{{ExtensionInstall
|localsettingsearly=
$wgUseAjax = true; // this must be included before the extension is loaded
}}
  • <translate> [[<tvar name=2>Special:ExtensionDistributor/MyExtension</tvar>|Download]] and move the extracted <tvar name=name>MyExtension</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    $wgUseAjax = true; // this must be included before the extension is loaded
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

DB Update

{{ExtensionInstall
|db-update=Yes
}}
  • <translate> [[<tvar name=2>Special:ExtensionDistributor/MyExtension</tvar>|Download]] and move the extracted <tvar name=name>MyExtension</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • <translate> Run the [[<tvar name=update>Special:MyLanguage/Manual:Update.php</tvar>|update script]] which will automatically create the necessary database tables that this extension needs.</translate>
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Composer

{{ExtensionInstall
|composer=Yes
}}
  • <translate> [[<tvar name=2>Special:ExtensionDistributor/MyExtension</tvar>|Download]] and move the extracted <tvar name=name>MyExtension</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
  • <translate> Only when installing from Git, run <tvar name=composer>Composer</tvar> to install PHP dependencies, by issuing <tvar name=code>composer install --no-dev</tvar> in the extension directory.</translate> <translate> (See <tvar name=phab><translate> task <tvar name=1>T173141</tvar></translate></tvar> for potential complications.)</translate>
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Custom steps

{{ExtensionInstall
|custom-steps=
* Lorem ipsum dolor sit amet
* Foo bar baz quux [[sandbox]]
}}
  • <translate> [[<tvar name=2>Special:ExtensionDistributor/MyExtension</tvar>|Download]] and move the extracted <tvar name=name>MyExtension</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • Lorem ipsum dolor sit amet
  • Foo bar baz quux sandbox
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Support registration

{{ExtensionInstall
|registration=1
}}
  • <translate> [[<tvar name=2>Special:ExtensionDistributor/MyExtension</tvar>|Download]] and move the extracted <tvar name=name>MyExtension</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    wfLoadExtension( 'MyExtension' );
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Support registration with minimum version

{{ExtensionInstall
|registration=1
|no-registration-version=1.39
}}
  • <translate> [[<tvar name=2>Special:ExtensionDistributor/MyExtension</tvar>|Download]] and move the extracted <tvar name=name>MyExtension</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    wfLoadExtension( 'MyExtension' );
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

<translate> To users running MediaWiki <tvar name=1>1.39</tvar> or earlier: </translate>

<translate> The instructions above describe the new way of installing this extension using <tvar name=LoadExtension>wfLoadExtension()</tvar>.</translate> <translate> If you need to install this extension on these earlier versions (MediaWiki <tvar name=1>1.39</tvar> and earlier), instead of <tvar name=code>wfLoadExtension( 'MyExtension' );</tvar>, you need to use:</translate>

require_once "$IP/extensions/MyExtension/MyExtension.php";

This only works if the version specified is 1.35 or later, otherwise the template assumes nobody cares about ancient versions and falls back to #Require registration.

Require registration

{{ExtensionInstall
|registration=required
}}
  • <translate> [[<tvar name=2>Special:ExtensionDistributor/MyExtension</tvar>|Download]] and move the extracted <tvar name=name>MyExtension</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    wfLoadExtension( 'MyExtension' );
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Everything

{{ExtensionInstall|Example
|download-link=[http://bits.wikimedia.org/example.zip Download]
|vagrant=example
|localsettings=
$wgUseAjax = true;

|db-update=Yes
|composer=Yes
|custom-steps=
* Lorem ipsum dolor sit amet
* Foo bar baz quux [[sandbox]]
|registration=yes
}}
  • <translate> <tvar name=1>Download</tvar> and place the file(s) in a directory called <tvar name=name>Example</tvar> in your <tvar name=ext>extensions/</tvar> folder.</translate>
  • <translate> Only when installing from Git, run <tvar name=composer>Composer</tvar> to install PHP dependencies, by issuing <tvar name=code>composer install --no-dev</tvar> in the extension directory.</translate> <translate> (See <tvar name=phab><translate> task <tvar name=1>T173141</tvar></translate></tvar> for potential complications.)</translate>
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    wfLoadExtension( 'Example' );
    $wgUseAjax = true;
    
  • <translate> Run the [[<tvar name=update>Special:MyLanguage/Manual:Update.php</tvar>|update script]] which will automatically create the necessary database tables that this extension needs.</translate>
  • Lorem ipsum dolor sit amet
  • Foo bar baz quux sandbox
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

<translate> To users running MediaWiki <tvar name=1>1.39</tvar> or earlier: </translate>

<translate> The instructions above describe the new way of installing this extension using <tvar name=LoadExtension>wfLoadExtension()</tvar>.</translate> <translate> If you need to install this extension on these earlier versions (MediaWiki <tvar name=1>1.39</tvar> and earlier), instead of <tvar name=code>wfLoadExtension( 'Example' );</tvar>, you need to use:</translate>

require_once "$IP/extensions/Example/Example.php";


<translate> Vagrant installation:</translate>

  • <translate> If using <tvar name=vagrant>Vagrant </tvar>, install with <tvar name=code>vagrant roles enable example --provision</tvar></translate>