Extension:Foxway
Foxway Release status: experimental |
|
---|---|
Implementation | Tag , Parser function |
Description | Adds in the wikitext parser that can interpret and execute PHP code |
Author(s) | Pavel Astakhov (pastakhovtalk) |
Latest version | 0.5.1 (2013-07-02) |
MediaWiki | |
PHP | 5.3+ |
Database changes | No |
License | GNU General Public License 2.0 or later |
Download | сhangelog |
Example | test.foxway.org |
|
|
foxway |
|
Translate the Foxway extension if it is available at translatewiki.net | |
The Foxway extension can interpret and execute PHP code in wiki page.
Usage
The <foxway> tag is used to embed blocks of PHP code into wikitext, which are then executed.
The standard PHP functions echo
may be used to pass output back to the parser.
<foxway>
$foo = 'hello world';
echo ucfirst( $foo . "!!!\n" );
</foxway>
It will display:
Hello world!!!
Variable scope
- All variables declarations persist from one block/expression to the next, throughout the page.
- Any variable used inside a page is by default limited to the local page scope.
- You can declare a global variables, are they also will be available through a special variable $GLOBALS
- You can declare a static variable, are they exists only in a local page scope, but it does not lose its value when program execution leaves this scope
Parameters
$argv — Array of arguments passed to a page when it is transcluded
Functions
Implemented support for most of the functions PHP (array, Math, Regular expression, String and Variable handling Functions)
Features
- Easy to install
- No additional libraries
- Easy to use
- Syntax is similar to PHP
- Powerful
- Has many functions for work with variables, strings, arrays, regular expressions
- Customizable
- You can specify the namespaces and functions, which is available for use with this extension
- Integrated Debugger
- Debug toolbar shows the step by step execution of operations and the values of variables
Download
The extension can be retrieved directly from Git [?]:
- Browse code
- Some extensions have tags for stable releases.
- Browse tags
- Select the tag
- Click "snapshot"
- Each branch is associated with a past MediaWiki release. There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).
- Browse branches
- Select a branch name
- Click "Continue"
Extract the snapshot and place it in the extensions/Foxway/ directory of your MediaWiki installation.
If you are familiar with Git and have shell access to your server, you can also obtain the extension as follows:
cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Foxway.git
Installation
- Download and move the extracted
Foxway
folder to yourextensions/
directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Foxway - Add the following code at the bottom of your LocalSettings.php file:
require_once "$IP/extensions/Foxway/Foxway.php";
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Configuration parameters
- $wgFoxwayFunctions
- Contains an array of implemented functions, which is available to users. You can disable any of the functions are at your discretion.
- $wgNamespacesWithFoxway
- For specifying the namespaces in which is allowed to use the extension Foxway.
- $wgFoxway_max_execution_time
- The maximum time that is allocated foxway (it is not CPU time, it is real time).
- $wgFoxway_max_execution_time_for_scope
- The maximum time that is allocated to each foxway scope (each of the included page)
This extension has been archived.
This extension has not been maintained for some time, and no longer supports recent releases of MediaWiki. To see the page before archival, click here. |
This extension has been archived.
This extension has not been maintained for some time, and no longer supports recent releases of MediaWiki. To see the page before archival, click here. |
See also
- Extension:Scribunto framework for embedding scripting languages into MediaWiki pages
- Extension:Lua allow you to embed blocks of Lua code into your pages
- Extension:PHPTemplates allows you to embed white-listed PHP code in pages
- Extension:Script The Script extension does compute with R, and test script of R, Perl, PHP and etc
- Extension:StackFunctions implements a programming language which is basically PostScript without graphics