Template:ExtensionInstall
- ダウンロードして、ファイルを
extensions/フォルダー内のExtensionInstallという名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ExtensionInstall
- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
require_once "$IP/extensions/ExtensionInstall/ExtensionInstall.php";
完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
| このテンプレートは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 requires the update script to be run, set this parameter to any value. (For example, if it has one or more database tables that need to be created.)
| 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}}
- ダウンロードして、ファイルを
extensions/フォルダー内のMyExtensionという名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
require_once "$IP/extensions/MyExtension/MyExtension.php";完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
名前
{{ExtensionInstall|CategoryTree}}
- ダウンロードして、ファイルを
extensions/フォルダー内のCategoryTreeという名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
require_once "$IP/extensions/CategoryTree/CategoryTree.php";完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
ダウンロード リンク
{{ExtensionInstall
|download-link=[http://bits.wikimedia.org/example.zip Download]
}}
- Downloadして、ファイルを
extensions/フォルダー内のMyExtensionという名前のディレクトリ内に配置します。- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
require_once "$IP/extensions/MyExtension/MyExtension.php";完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
LocalSettings
{{ExtensionInstall
|localsettings=
$wgUseAjax = true;
}}
- ダウンロードして、ファイルを
extensions/フォルダー内のMyExtensionという名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
require_once "$IP/extensions/MyExtension/MyExtension.php"; $wgUseAjax = true;完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
早めにLocalSettings
{{ExtensionInstall
|localsettingsearly=
$wgUseAjax = true; // This must be included before the extension is loaded
}}
- ダウンロードして、ファイルを
extensions/フォルダー内のMyExtensionという名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
$wgUseAjax = true; // This must be included before the extension is loaded require_once "$IP/extensions/MyExtension/MyExtension.php";完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
データベースの更新
{{ExtensionInstall
|db-update=Yes
}}
- ダウンロードして、ファイルを
extensions/フォルダー内のMyExtensionという名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
require_once "$IP/extensions/MyExtension/MyExtension.php";- 更新スクリプトを実行します。このスクリプトは、この拡張機能が必要とするデータベーステーブルを自動的に作成します。
完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
Composer
{{ExtensionInstall
|composer=Yes
}}
- ダウンロードして、ファイルを
extensions/フォルダー内のMyExtensionという名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- Gitでのインストールの場合のみ、PHPの依存関係をインストールするためComposerを実行します。 (合併症の可能性についてはT173141を参照。)
- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
require_once "$IP/extensions/MyExtension/MyExtension.php";完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
カスタム手順
{{ExtensionInstall
|custom-steps=
* Lorem ipsum dolor sit amet
* Foo bar baz quux [[sandbox]]
}}
- ダウンロードして、ファイルを
extensions/フォルダー内のMyExtensionという名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
require_once "$IP/extensions/MyExtension/MyExtension.php";- Lorem ipsum dolor sit amet
- Foo bar baz quux sandbox
完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
登録への対応
{{ExtensionInstall
|registration=1
}}
- ダウンロードして、ファイルを
extensions/フォルダー内のMyExtensionという名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
wfLoadExtension( 'MyExtension' );完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
Support registration with minimum version
{{ExtensionInstall
|registration=1
|no-registration-version=1.39
}}
- ダウンロードして、ファイルを
extensions/フォルダー内のMyExtensionという名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
wfLoadExtension( 'MyExtension' );完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
MediaWiki 1.39以前を稼働させている利用者へ:
上記の手順では、
wfLoadExtension()を使用してこの拡張機能をインストールする新しい方法を記載しています。 この拡張機能をこれらの過去のバージョン (MediaWiki 1.39以前) にインストールする必要がある場合は、wfLoadExtension( 'MyExtension' );の代わりに以下を使用する必要があります: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
}}
- ダウンロードして、ファイルを
extensions/フォルダー内のMyExtensionという名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
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して、ファイルを
extensions/フォルダー内のExampleという名前のディレクトリ内に配置します。- Gitでのインストールの場合のみ、PHPの依存関係をインストールするためComposerを実行します。 (合併症の可能性についてはT173141を参照。)
- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
wfLoadExtension( 'Example' ); $wgUseAjax = true;- 更新スクリプトを実行します。このスクリプトは、この拡張機能が必要とするデータベーステーブルを自動的に作成します。
- Lorem ipsum dolor sit amet
- Foo bar baz quux sandbox
完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
MediaWiki 1.39以前を稼働させている利用者へ:
上記の手順では、
wfLoadExtension()を使用してこの拡張機能をインストールする新しい方法を記載しています。 この拡張機能をこれらの過去のバージョン (MediaWiki 1.39以前) にインストールする必要がある場合は、wfLoadExtension( 'Example' );の代わりに以下を使用する必要があります:require_once "$IP/extensions/Example/Example.php";
Vagrantでのインストール:
- Vagrantを使用している場合は、
vagrant roles enable example --provisionでインストールしてください。