Шаблон:Инсталиране на разширение

From mediawiki.org
This page is a translated version of the page Template:ExtensionInstall and the translation is 61% complete.
Outdated translations are marked like this.
  • Download and place the file(s) in a directory called ExtensionInstall in your extensions/ folder.
  • На дъното на вашия $LocalSettings добавете следния код:
    require_once "$IP/extensions/ExtensionInstall/ExtensionInstall.php";
    
  • Yes Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.
Template documentation

Употреба

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Extension name1

Set the extension name manually.

Default
The current page name without namespace prefix.
Auto value
{{ROOTPAGENAME}}
Stringoptional
Vagrant role namevagrant

If given, shows how to install extension with the Vagrant's enable-role command

Auto value
Stringoptional
Download linkdownload-link

Overwrite the download link.

Default
Link to Special:ExtensionDistributor with the extension name.
URLoptional
LocalSettings earlylocalsettingsearly

Pass custom php code that the user should include in [[LocalSettings.php]] before the extension is loaded.

Example
$wgUseAjax = true; //must be included before the extension is loaded
Unknownoptional
LocalSettingslocalsettings

Pass custom php code that the user should include in [[LocalSettings.php]].

Example
$wgUseAjax = true;
Unknownoptional
Database updatedb-update

If the extension has one or more database tables that need to be created through [[update.php]], set this parameter to any value.

Default
false
Booleanoptional
Composercomposer

If the extension uses [[Composer]] to manage dependencies, set this parameter to any value.

Default
false
Booleanoptional
Custom steps 0custom-steps0

Additional steps before download, e.g. other required extensions (as an unordered "* list")

Contentoptional
Custom stepscustom-steps

Additional steps (as an unordered "* list")

Contentoptional
Supports registrationregistration

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.

Stringoptional
No registration versionno-registration-version

The MediaWiki version for which extension registration should not be used

Default
1.24
Unknownoptional

Примери

По-долу даваме няколко примери за използването на този шаблон.

Просто

{{ExtensionInstall}}
  • Download and place the file(s) in a directory called MyExtension in your extensions/ folder.
  • На дъното на вашия $LocalSettings добавете следния код:
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • Yes Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.

Име

{{ExtensionInstall|CategoryTree}}
  • Download and place the file(s) in a directory called CategoryTree in your extensions/ folder.
  • На дъното на вашия $LocalSettings добавете следния код:
    require_once "$IP/extensions/CategoryTree/CategoryTree.php";
    
  • Yes Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.

Препратка за изтегляне

{{ExtensionInstall
|download-link=[http://bits.wikimedia.org/example.zip Download]
}}
  • Download и поставете файла (файловете) в директория, наречена MyExtension във вашата директория extensions/.
  • На дъното на вашия $LocalSettings добавете следния код:
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • Yes Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.

LocalSettings

{{ExtensionInstall
|localsettings=
$wgUseAjax = true;
}}
  • Download and place the file(s) in a directory called MyExtension in your extensions/ folder.
  • На дъното на вашия $LocalSettings добавете следния код:
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    $wgUseAjax = true;
    
  • Yes Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.

LocalSettings early

{{ExtensionInstall
|localsettingsearly=
$wgUseAjax = true; // this must be included before the extension is loaded
}}
  • Download and place the file(s) in a directory called MyExtension in your extensions/ folder.
  • На дъното на вашия $LocalSettings добавете следния код:
    $wgUseAjax = true; // this must be included before the extension is loaded
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • Yes Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.

Поднова на базата данни

{{ExtensionInstall
|db-update=Yes
}}
  • Download and place the file(s) in a directory called MyExtension in your extensions/ folder.
  • На дъното на вашия $LocalSettings добавете следния код:
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • Изпълнете скрипта за поднова, който автоматично ще създаде нужните таблици в базата данни, които използват се от това разширение.
  • Yes Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.

Composer

{{ExtensionInstall
|composer=Yes
}}
  • Download and place the file(s) in a directory called MyExtension in your extensions/ folder.
  • Only when installing from Git, run Composer to install PHP dependencies, by issuing composer install --no-dev in the extension directory. (See task T173141 for potential complications.)
  • На дъното на вашия $LocalSettings добавете следния код:
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • Yes Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.

Персонализируеми стъпки

{{ExtensionInstall
|custom-steps=
* Lorem ipsum dolor sit amet
* Foo bar baz quux [[sandbox]]
}}
  • Download and place the file(s) in a directory called MyExtension in your extensions/ folder.
  • На дъното на вашия $LocalSettings добавете следния код:
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • Lorem ipsum dolor sit amet
  • Foo bar baz quux sandbox
  • Yes Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.

Поддръжка на регистрация

{{ExtensionInstall
|registration=1
}}
  • Download and place the file(s) in a directory called MyExtension in your extensions/ folder.
  • На дъното на вашия $LocalSettings добавете следния код:
    wfLoadExtension( 'MyExtension' );
    
  • Yes Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.

За потребителите на МедияУики 1.24 и предишните версии:

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.24 and earlier), instead of wfLoadExtension( 'MyExtension' );, you need to use:

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

Set recommended registration MediaWiki version

{{ExtensionInstall
|registration=1
|no-registration-version=1.25
}}
  • Download and place the file(s) in a directory called MyExtension in your extensions/ folder.
  • На дъното на вашия $LocalSettings добавете следния код:
    wfLoadExtension( 'MyExtension' );
    
  • Yes Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.

За потребителите на МедияУики 1.25 и предишните версии:

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.25 and earlier), instead of wfLoadExtension( 'MyExtension' );, you need to use:

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

Задължителна регистрация

{{ExtensionInstall
|registration=required
}}
  • Download and place the file(s) in a directory called MyExtension in your extensions/ folder.
  • На дъното на вашия $LocalSettings добавете следния код:
    wfLoadExtension( 'MyExtension' );
    
  • Yes Готово – Отидете на 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-dev in the extension directory. (See task T173141 for potential complications.)
  • На дъното на вашия $LocalSettings добавете следния код:
    wfLoadExtension( 'Example' );
    $wgUseAjax = true;
    
  • Изпълнете скрипта за поднова, който автоматично ще създаде нужните таблици в базата данни, които използват се от това разширение.
  • Lorem ipsum dolor sit amet
  • Foo bar baz quux sandbox
  • Yes Готово – Отидете на Special:Version в уикито си, за да проверите дали разширението е успешно инсталирано.

За потребителите на МедияУики 1.24 и предишните версии:

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.24 and earlier), instead of wfLoadExtension( 'Example' );, you need to use:

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


Vagrant installation:

  • Ако използвате Vagrant , инсталирайте разширението с vagrant roles enable example --provision