MediaWiki REL1_34
Scribunto_LuaTextLibrary Class Reference
Inheritance diagram for Scribunto_LuaTextLibrary:
Collaboration diagram for Scribunto_LuaTextLibrary:

Public Member Functions

 getEntityTable ()
 Handler for getEntityTable.
 
 jsonDecode ( $s, $flags)
 Handler for jsonDecode.
 
 jsonEncode ( $value, $flags)
 Handler for jsonEncode.
 
 killMarkers ( $s)
 Handler for killMarkers.
 
 register ()
 Called to register the library.
 
 textUnstrip ( $s)
 Handler for textUnstrip.
 
 textUnstripNoWiki ( $s)
 Handler for textUnstripNoWiki.
 
- Public Member Functions inherited from Scribunto_LuaLibraryBase
 __construct (Scribunto_LuaEngine $engine)
 
 incrementExpensiveFunctionCount ()
 Increment the expensive function count, and throw if limit exceeded.
 

Public Attributes

const JSON_PRESERVE_KEYS = 1
 
const JSON_PRETTY = 4
 
const JSON_TRY_FIXING = 2
 

Static Private Member Functions

static reindexArrays (array $arr, $isEncoding)
 Recursively reindex array with integer keys to 0-based or 1-based.
 

Additional Inherited Members

- Protected Member Functions inherited from Scribunto_LuaLibraryBase
 checkType ( $name, $argIdx, $arg, $expectType)
 Check the type of a variable.
 
 checkTypeOptional ( $name, $argIdx, &$arg, $expectType, $default)
 Check the type of a variable, with default if null.
 
 getEngine ()
 Get the engine.
 
 getInterpreter ()
 Get the interpreter.
 
 getLuaType ( $var)
 Get the Lua type corresponding to the type of the variable.
 
 getParser ()
 Get the parser.
 
 getParserOptions ()
 Get the parser options.
 
 getTitle ()
 Get the title.
 

Detailed Description

Definition at line 3 of file TextLibrary.php.

Member Function Documentation

◆ getEntityTable()

Scribunto_LuaTextLibrary::getEntityTable ( )

Handler for getEntityTable.

Definition at line 86 of file TextLibrary.php.

◆ jsonDecode()

Scribunto_LuaTextLibrary::jsonDecode ( $s,
$flags )

Handler for jsonDecode.

Definition at line 120 of file TextLibrary.php.

References $s, Scribunto_LuaLibraryBase\checkType(), Scribunto_LuaLibraryBase\checkTypeOptional(), and reindexArrays().

◆ jsonEncode()

Scribunto_LuaTextLibrary::jsonEncode ( $value,
$flags )

Handler for jsonEncode.

Definition at line 100 of file TextLibrary.php.

References Scribunto_LuaLibraryBase\checkTypeOptional(), and reindexArrays().

◆ killMarkers()

Scribunto_LuaTextLibrary::killMarkers ( $s)

Handler for killMarkers.

Definition at line 76 of file TextLibrary.php.

References $s, Scribunto_LuaLibraryBase\checkType(), and Scribunto_LuaLibraryBase\getParser().

◆ register()

Scribunto_LuaTextLibrary::register ( )

Called to register the library.

This should do any necessary setup and then call $this->getEngine()->registerInterface(). The value returned by that call should be returned from this function, and must be for 'deferLoad' libraries to work right.

Returns
array Lua package

Reimplemented from Scribunto_LuaLibraryBase.

Definition at line 9 of file TextLibrary.php.

References $wgUrlProtocols, Scribunto_LuaLibraryBase\getEngine(), and wfMessage().

◆ reindexArrays()

static Scribunto_LuaTextLibrary::reindexArrays ( array $arr,
$isEncoding )
staticprivate

Recursively reindex array with integer keys to 0-based or 1-based.

Parameters
array$arr
bool$isEncoding
Returns
array

Definition at line 144 of file TextLibrary.php.

References reindexArrays().

Referenced by jsonDecode(), jsonEncode(), and reindexArrays().

◆ textUnstrip()

Scribunto_LuaTextLibrary::textUnstrip ( $s)

Handler for textUnstrip.

Definition at line 53 of file TextLibrary.php.

References $s, Scribunto_LuaLibraryBase\checkType(), and Scribunto_LuaLibraryBase\getParser().

◆ textUnstripNoWiki()

Scribunto_LuaTextLibrary::textUnstripNoWiki ( $s)

Handler for textUnstripNoWiki.

Definition at line 65 of file TextLibrary.php.

References $s, Scribunto_LuaLibraryBase\checkType(), and Scribunto_LuaLibraryBase\getParser().

Member Data Documentation

◆ JSON_PRESERVE_KEYS

const Scribunto_LuaTextLibrary::JSON_PRESERVE_KEYS = 1

Definition at line 5 of file TextLibrary.php.

◆ JSON_PRETTY

const Scribunto_LuaTextLibrary::JSON_PRETTY = 4

Definition at line 7 of file TextLibrary.php.

◆ JSON_TRY_FIXING

const Scribunto_LuaTextLibrary::JSON_TRY_FIXING = 2

Definition at line 6 of file TextLibrary.php.


The documentation for this class was generated from the following file: