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

Public Member Functions

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

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. More...
 

Additional Inherited Members

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

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 
)

◆ jsonEncode()

Scribunto_LuaTextLibrary::jsonEncode (   $value,
  $flags 
)

Handler for jsonEncode.

Definition at line 100 of file TextLibrary.php.

References FormatJson\ALL_OK, Scribunto_LuaLibraryBase\checkTypeOptional(), FormatJson\encode(), 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.

Referenced by jsonDecode(), and jsonEncode().

◆ 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: