Stato della release: beta
|Implementazione||Tag, Parser function, Hook|
|Descrizione||Allows users to use the Magic expressions with PHP language syntax|
|Autore(i)||Pavel Astakhov (pastakhovtalk)|
|Cambi della base di dati||No|
|Licenza||GNU General Public License 2.0 or later|
|Traducete l'estensione PhpTags se è disponibile su translatewiki.net|
|Verificare uso e versione della matrice.|
|Problemi||Compiti aperti · Riportare un bug|
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>. It can be located in any namespace if it is allowed by the variable
<phptag> $foo = 'hello world'; echo ucfirst( $foo . "!!!\n" ); </phptag>
It will display:
ucfirstis implemented in Extension:PhpTags_Functions. More details can be found in the quick start guide.
- If using Vagrant, install with
vagrant roles enable phptags --provision
- Manual installation
- Download and place the file(s) in a directory called
- Add the following code at the bottom of your LocalSettings.php:
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
- 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.
The main extensions are:
- PhpTags Wiki - lets you query various data from MediaWiki core
- PhpTags Functions - contains many functions for data processing
- PhpTags Widgets - displays the data in different ways
|$wgPhpTagsMaxLoops||Maximum number of allowed loops||1000|
|$wgPhpTagsNamespaces||Array of namespaces in which the PhpTags extension is allowed to use. Boolean
|$wgPhpTagsBytecodeExptime||Storage time of the compiled bytecode in cache (30 days)||2592000 (30 giorni)|