Extension:PhpTags
![]() リリースの状態: ベータ |
|
---|---|
実装 | タグ , パーサー関数 , フック |
説明 | 利用者が PHP 言語の構文でマジック表現を使用できるようにする |
作者 | Pavel Astakhov (pastakhovトーク) |
最新バージョン | 5.5.0 (2015-11-20) |
MediaWiki | 1.25+ |
PHP | 5.3+ |
ライセンス | GNU 一般公衆利用許諾書 2.0 以降 |
ダウンロード | |
|
|
phptag |
|
Quarterly downloads | 12 (Ranked 162nd) |
translatewiki.net で翻訳を利用できる場合は、PhpTags 拡張機能の翻訳にご協力ください | |
問題点 | 未解決のタスク · バグを報告 |
The PhpTags extension implements the concept of Magic expressions with PHP language syntax that allows you to create and use compatible but not monolithic MediaWiki extensions, which greatly increases the convenience, flexibility and performance. More ...
説明
The PhpTags extension has its own the runtime environment PHP code which supports scalar types, arrays, variables, operators, control structures. It also supports constants, functions and objects but it does not implement any of them except for some language constructs.
When using a function, object or constant PhpTags calls corresponding extension. Therefore, a set of constants, functions, objects and actions that they produce only depend on additionally installed compatible extensions which can be found here.
PhpTags designed so to be as similar to native PHP, therefore you should have the illusion of direct execution PHP code although this never happens.
使用法
The code should be placed between the tags <phptag>
and </phptag>
. It can be located in any namespace if it is allowed by the variable $wgPhpTagsNamespaces
.
<phptag>
$foo = 'hello world';
echo ucfirst( $foo . "!!!\n" );
</phptag>
以下のように表示されます :
Hello world!!!
ucfirst
is implemented in Extension:PhpTags Functions . More details can be found in the quick start guide.
インストール
- ダウンロードして、ファイルを
extensions/
フォルダー内のPhpTags
という名前のディレクトリ内に配置します。 - 以下のコードを
LocalSettings.php
の末尾に追加します:require_once "$IP/extensions/PhpTags/PhpTags.php";
完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
Vagrant installation:
- Vagrant を使用している場合は、
vagrant roles enable phptags --provision
でインストールしてください。
省略可能なインストール
- CodeMirror extension provides code highlighting in article editor
追加的なインストール
The PhpTags extension (core) implements magic expressions only and not, for instance, any PHP function.
For additional features such as functions, you can install additional extensions which are compatible with the magic expressions of the PhpTags extension.
主な拡張機能 :
- Extension:PhpTags Wiki - lets you query various data from MediaWiki core
- Extension:PhpTags Functions - contains many functions for data processing
- Extension:PhpTags Widgets - displays the data in different ways
Others are Extension:PhpTags SMW and Extension:PhpTags Storage .
構成パラメーター
名前 | 説明 | 既定値 |
---|---|---|
$wgPhpTagsMaxLoops | 最大許容可能ループ数 | 1000 |
$wgPhpTagsNamespaces | Array of namespaces in which the PhpTags extension is allowed to use. Boolean true allows usage in all namespaces
|
true
|
$wgPhpTagsBytecodeExptime | Storage time of the compiled bytecode in cache (30 days) | 2592000 (30 日) |
- Beta status extensions/ja
- Tag extensions/ja
- Parser function extensions/ja
- Hook extensions/ja
- GPL licensed extensions/ja
- Extensions in Wikimedia version control/ja
- ExtensionTypes extensions/ja
- ParserAfterTidy extensions/ja
- ParserFirstCallInit extensions/ja
- ParserLimitReport extensions/ja
- PhpTagsRuntimeFirstInit extensions/ja
- All extensions/ja
- Modifiable variables extensions/ja