Шаблон:Инсталиране на разширение
- Download and move the extracted
ExtensionInstallfolder to yourextensions/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
- На дъното на вашия $LocalSettings добавете следния код:
require_once "$IP/extensions/ExtensionInstall/ExtensionInstall.php";
Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.
| Uses Lua: |
Употреба
Installation instructions.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Extension name | 1 | Set the extension name manually.
| String | optional |
| Git submodule | git-submodule | Add --recurse-submodules to the git clone command | Boolean | optional |
| Vagrant role name | vagrant | If given, shows how to install extension with the Vagrant's enable-role command | String | optional |
| Download link | download-link | Overwrite the download link.
| URL | optional |
| LocalSettings early | localsettingsearly | Pass custom php code that the user should include in [[LocalSettings.php]] before the extension is loaded.
| Unknown | optional |
| LocalSettings | localsettings | Pass custom PHP code that the user should include in [[LocalSettings.php]].
| Unknown | optional |
| Database update | db-update | If the extension has one or more database tables that need to be created through [[update.php]], set this parameter to any value.
| Boolean | optional |
| Composer | composer | If the extension uses Composer to manage dependencies, set this parameter to any value. Not that this does not indicate that the extension is able to be installed with Composer.
| Boolean | optional |
| Custom steps 0 | custom-steps0 | Additional steps before download, e.g. other required extensions (as an unordered "* list"). | Content | optional |
| Custom steps | custom-steps | Additional steps (as an unordered "* list"). | Content | optional |
| Supports registration | registration | Changes the template to use <code>wfLoadExtension()</code> if it supports registration. Set to any value if the extension supports registration, or to <code>required</code> if it <em>only</em> supports registration and doesn't support the old-style of loading. | String | optional |
| No registration version | no-registration-version | The MediaWiki version for which extension registration should not be used.
| Unknown | optional |
See also
Примери
По-долу даваме няколко примери за използването на този шаблон.
Просто
{{ExtensionInstall}}
- Download and move the extracted
MyExtensionfolder to yourextensions/directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- На дъното на вашия $LocalSettings добавете следния код:
require_once "$IP/extensions/MyExtension/MyExtension.php";Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.
Име
{{ExtensionInstall|CategoryTree}}
- Download and move the extracted
CategoryTreefolder to yourextensions/directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree- На дъното на вашия $LocalSettings добавете следния код:
require_once "$IP/extensions/CategoryTree/CategoryTree.php";Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.
Препратка за изтегляне
{{ExtensionInstall
|download-link=[http://bits.wikimedia.org/example.zip Download]
}}
- Download и поставете файла (файловете) в директория, наречена
MyExtensionвъв вашата директорияextensions/.- На дъното на вашия $LocalSettings добавете следния код:
require_once "$IP/extensions/MyExtension/MyExtension.php";Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.
LocalSettings
{{ExtensionInstall
|localsettings=
$wgUseAjax = true;
}}
- Download and move the extracted
MyExtensionfolder to yourextensions/directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- На дъното на вашия $LocalSettings добавете следния код:
require_once "$IP/extensions/MyExtension/MyExtension.php"; $wgUseAjax = true;Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.
LocalSettings early
{{ExtensionInstall
|localsettingsearly=
$wgUseAjax = true; // This must be included before the extension is loaded
}}
- Download and move the extracted
MyExtensionfolder to yourextensions/directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- На дъното на вашия $LocalSettings добавете следния код:
$wgUseAjax = true; // This must be included before the extension is loaded require_once "$IP/extensions/MyExtension/MyExtension.php";Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.
Поднова на базата данни
{{ExtensionInstall
|db-update=Yes
}}
- Download and move the extracted
MyExtensionfolder to yourextensions/directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- На дъното на вашия $LocalSettings добавете следния код:
require_once "$IP/extensions/MyExtension/MyExtension.php";- Изпълнете скрипта за поднова, който автоматично ще създаде нужните таблици в базата данни, които използват се от това разширение.
Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.
Composer
{{ExtensionInstall
|composer=Yes
}}
- Download and move the extracted
MyExtensionfolder to yourextensions/directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- Only when installing from Git, run Composer to install PHP dependencies, by issuing
composer install --no-devin the extension directory. (See T173141 for potential complications.)- На дъното на вашия $LocalSettings добавете следния код:
require_once "$IP/extensions/MyExtension/MyExtension.php";Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.
Персонализируеми стъпки
{{ExtensionInstall
|custom-steps=
* Lorem ipsum dolor sit amet
* Foo bar baz quux [[sandbox]]
}}
- Download and move the extracted
MyExtensionfolder to yourextensions/directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- На дъното на вашия $LocalSettings добавете следния код:
require_once "$IP/extensions/MyExtension/MyExtension.php";- Lorem ipsum dolor sit amet
- Foo bar baz quux sandbox
Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.
Поддръжка на регистрация
{{ExtensionInstall
|registration=1
}}
- Download and move the extracted
MyExtensionfolder to yourextensions/directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- На дъното на вашия $LocalSettings добавете следния код:
wfLoadExtension( 'MyExtension' );Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.
Support registration with minimum version
{{ExtensionInstall
|registration=1
|no-registration-version=1.39
}}
- Download and move the extracted
MyExtensionfolder to yourextensions/directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- На дъното на вашия $LocalSettings добавете следния код:
wfLoadExtension( 'MyExtension' );Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.
За потребителите на МедияУики 1.39 и предишните версии:
The instructions above describe the new way of installing this extension using
wfLoadExtension(). If you need to install this extension on these earlier versions (MediaWiki 1.39 and earlier), instead ofwfLoadExtension( 'MyExtension' );, you need to use: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.
Задължителна регистрация
{{ExtensionInstall
|registration=required
}}
- Download and move the extracted
MyExtensionfolder to yourextensions/directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- На дъното на вашия $LocalSettings добавете следния код:
wfLoadExtension( 'MyExtension' );Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.
Всичко
{{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
}}
- Download и поставете файла (файловете) в директория, наречена
Exampleвъв вашата директорияextensions/.- Only when installing from Git, run Composer to install PHP dependencies, by issuing
composer install --no-devin the extension directory. (See T173141 for potential complications.)- На дъното на вашия $LocalSettings добавете следния код:
wfLoadExtension( 'Example' ); $wgUseAjax = true;- Изпълнете скрипта за поднова, който автоматично ще създаде нужните таблици в базата данни, които използват се от това разширение.
- Lorem ipsum dolor sit amet
- Foo bar baz quux sandbox
Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.
За потребителите на МедияУики 1.39 и предишните версии:
The instructions above describe the new way of installing this extension using
wfLoadExtension(). If you need to install this extension on these earlier versions (MediaWiki 1.39 and earlier), instead ofwfLoadExtension( 'Example' );, you need to use:require_once "$IP/extensions/Example/Example.php";
Vagrant installation:
- Ако използвате Vagrant, инсталирайте разширението с
vagrant roles enable example --provision