MediaWiki REL1_33
LuaLibrary.php
Go to the documentation of this file.
1<?php
2
4
5use Scribunto_LuaError;
6use Scribunto_LuaLibraryBase;
7
8class LuaLibrary extends Scribunto_LuaLibraryBase {
9 public function register() {
10 $lib = [
11 'expr' => [ $this, 'expr' ],
12 ];
13
14 return $this->getEngine()->registerInterface(
15 __DIR__ . '/mw.ext.ParserFunctions.lua', $lib, []
16 );
17 }
18
19 public function expr( $expression = null ) {
20 $this->checkType( 'mw.ext.ParserFunctions.expr', 1, $expression, 'string' );
21 try {
22 return [ ParserFunctions::getExprParser()->doExpression( $expression ) ];
23 } catch ( ExprError $e ) {
24 throw new Scribunto_LuaError( $e->getMessage() );
25 }
26 }
27
28}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
returning false will NOT prevent logging $e
Definition hooks.txt:2175
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Ge...
Definition ExprError.php:19