扩展:Php标签
此扩展目前不再活跃维护! 尽管它可能仍然工作,但任何错误报告或功能请求将很可能被忽略。 如果您对承担开发与维护该扩展的任务工作感兴趣,您可以请求自己的存储库。 As a courtesy, you may want to contact the author. 或者您应移除该模板,并在页面的{{Extension }}信息框中将您自己列为扩展的维护人员。 |
PhpTags 发行状态: 不再維護 |
|
---|---|
实现 | 标签 , 解析器函数 , 函数钩 |
描述 | 允许用户使用带PHP语法的魔术表达式 |
作者 | Pavel Astakhov (pastakhov留言) |
最新版本 | 5.5.0 (2015-11-20) |
MediaWiki | 1.25+ |
PHP | 5.3+ |
许可协议 | GNU通用公眾授權條款2.0或更新版本 |
下載 | |
|
|
phptag |
|
季度下載量 | 2 (Ranked 135th) |
前往translatewiki.net翻譯PhpTags扩展 | |
問題 | 开启的任务 · 报告错误 |
PhpTags扩展允许用户使用带PHP语法的魔术表达式,它允许您创建和使用兼容但不独立的MediaWiki扩展,设计适用于扩展设计时的初步性能测试。更多……
描述
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!!!
安裝
- 下载文件,并将解压后的
PhpTags
文件夹移动到extensions/
目录中。
开发者和代码贡献人员应从Git安装扩展,输入:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/PhpTags - 将下列代码放置在您的LocalSettings.php 的底部:
wfLoadExtension( 'PhpTags' );
- 完成 – 在您的wiki上导航至Special:Version,以验证已成功安装扩展。
使用Vagrant安装:
- 如果使用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.
主要的扩展有:
- 扩展: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 | Maximum number of allowed loops | 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天) |