Scribunto
-
- Last edited 6 years ago by Lsireta
-
-
- No status information
The Scribunto (Latin: "they shall write/let them write (in the future)") extension allows for embedding scripting languages in MediaWiki. Currently the only supported scripting language is Lua.
Contents
- 1 PCRE version compatibility[<a href="https://www.mediawiki.org/w/index.php?title=Extension:Scribunto&action=edit§ion=3" title="Edit section: PCRE version compatibility">edit]
- 2 Lua[<a href="https://www.mediawiki.org/w/index.php?title=Extension:Scribunto&action=edit§ion=24" title="Edit section: Lua">edit]
- 2.1 Learning Lua[<a href="https://www.mediawiki.org/w/index.php?title=Extension:Scribunto&action=edit§ion=25" title="Edit section: Learning Lua">edit]
- 2.2 Lua environment[<a href="https://www.mediawiki.org/w/index.php?title=Extension:Scribunto&action=edit§ion=26" title="Edit section: Lua environment">edit]
- 2.3 Blank screen[<a href="https://www.mediawiki.org/w/index.php?title=Extension:Scribunto&action=edit§ion=37" title="Edit section: Blank screen">edit]
PCRE version compatibility[<a href="https://www.mediawiki.org/w/index.php?title=Extension:Scribunto&action=edit§ion=3" title="Edit section: PCRE version compatibility">edit]
PCRE 8.33 or later is recommended. You can see the version of PCRE used by PHP by viewing a phpinfo() web page, or from the command line with the command php -i | grep 'PCRE'
.
- Scribunto will not work with versions of PCRE lower than 8.10.
- PCRE 8.31 has bugs with JIT pattern studying that breaks various patterns when used with HHVM.
- PCRE 8.32 has a bug that will cause it to reject certain non-character codepoints, which will cause errors in the mw.html module.
CentOS 6 and RHEL 6 are stuck on PCRE 7 and need to be upgraded.
Updating to 8.33 on a server with an older version may be relatively complicated. See Updating to PCRE 8.33 or Higher for details.
Lua[<a href="https://www.mediawiki.org/w/index.php?title=Extension:Scribunto&action=edit§ion=24" title="Edit section: Lua">edit]
Learning Lua[<a href="https://www.mediawiki.org/w/index.php?title=Extension:Scribunto&action=edit§ion=25" title="Edit section: Learning Lua">edit]
Lua is a simple programming language intended to be accessible to beginners. For a quick crash-course on Lua, try Learn Lua in 15 Minutes.
The best comprehensive introduction to Lua is the book Programming in Lua. The first edition (for Lua 5.0) is available online and is mostly relevant to Lua 5.1, the version used by Scribunto:
- Programming in Lua (scroll down past the book ads to find the text)
The reference manual is also useful:
Lua environment[<a href="https://www.mediawiki.org/w/index.php?title=Extension:Scribunto&action=edit§ion=26" title="Edit section: Lua environment">edit]
In Lua, the set of all global variables and functions is called an environment.
Each Script error: You must specify a function to call. call runs in a separate environment. Variables defined in one Script error: You must specify a function to call. will not be available from another. This restriction was necessary to maintain flexibility in the wikitext parser implementation.
Blank screen[<a href="https://www.mediawiki.org/w/index.php?title=Extension:Scribunto&action=edit§ion=37" title="Edit section: Blank screen">edit]
Make sure your extension version is applicable to your MediaWiki version.
Source: mediawiki