MediaWiki
1.34.4
|
Public Member Functions | |
cascadingProtection ( $text) | |
Handler for cascadingProtection. More... | |
getContent ( $text) | |
Handler for getContent. More... | |
getExpensiveData ( $text) | |
Extract expensive information from a Title object for return to Lua. More... | |
getFileInfo ( $text) | |
Handler for getFileInfo. More... | |
getUrl ( $text, $which, $query=null, $proto=null) | |
Get a URL referring to this title. More... | |
makeTitle ( $ns, $text, $fragment=null, $interwiki=null) | |
Handler for title.makeTitle. More... | |
newTitle ( $text_or_id, $defaultNamespace=null) | |
Handler for title.new. More... | |
protectionLevels ( $text) | |
Handler for protectionLevels. More... | |
redirectTarget ( $text) | |
Handler for redirectTarget. More... | |
register () | |
Called to register the library. More... | |
Public Member Functions inherited from Scribunto_LuaLibraryBase | |
__construct (Scribunto_LuaEngine $engine) | |
incrementExpensiveFunctionCount () | |
Increment the expensive function count, and throw if limit exceeded. More... | |
Private Member Functions | |
checkNamespace ( $name, $argIdx, &$arg, $default=null) | |
getContentInternal ( $text) | |
Utility to get a Content object from a title. More... | |
getInexpensiveTitleData (Title $title) | |
Extract inexpensive information from a Title object for return to Lua. More... | |
Static Private Member Functions | |
static | makeArrayOneBased ( $arr) |
Private Attributes | |
$idCache = [ 0 => null ] | |
$titleCache = [] | |
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... | |
Definition at line 3 of file TitleLibrary.php.
Scribunto_LuaTitleLibrary::cascadingProtection | ( | $text | ) |
Handler for cascadingProtection.
Definition at line 386 of file TitleLibrary.php.
References $t, $title, Scribunto_LuaLibraryBase\checkType(), Scribunto_LuaLibraryBase\incrementExpensiveFunctionCount(), makeArrayOneBased(), and Title\newFromText().
|
private |
Definition at line 29 of file TitleLibrary.php.
References $wgContLang, Scribunto_LuaLibraryBase\checkType(), and MWNamespace\exists().
Referenced by makeTitle(), and newTitle().
Scribunto_LuaTitleLibrary::getContent | ( | $text | ) |
Handler for getContent.
Definition at line 296 of file TitleLibrary.php.
References $content, Scribunto_LuaLibraryBase\checkType(), and getContentInternal().
|
private |
Utility to get a Content object from a title.
The title is counted as a transclusion.
$text | string Title text |
Definition at line 267 of file TitleLibrary.php.
References $title, Scribunto_LuaLibraryBase\getParser(), Title\newFromText(), and wfDebug().
Referenced by getContent(), and redirectTarget().
Scribunto_LuaTitleLibrary::getExpensiveData | ( | $text | ) |
Extract expensive information from a Title object for return to Lua.
This records a link to this title in the current ParserOutput and caches the title for repeated lookups. It may call incrementExpensiveFunctionCount() if the title is not already cached.
Definition at line 95 of file TitleLibrary.php.
References $title, Scribunto_LuaLibraryBase\checkType(), SpecialPageFactory\exists(), Scribunto_LuaLibraryBase\getParser(), Scribunto_LuaLibraryBase\incrementExpensiveFunctionCount(), Title\newFromText(), and NS_SPECIAL.
Scribunto_LuaTitleLibrary::getFileInfo | ( | $text | ) |
Handler for getFileInfo.
Definition at line 308 of file TitleLibrary.php.
References $file, $title, Scribunto_LuaLibraryBase\checkType(), Scribunto_LuaLibraryBase\getParser(), Scribunto_LuaLibraryBase\incrementExpensiveFunctionCount(), Title\newFromText(), NS_FILE, NS_MEDIA, and wfFindFile().
|
private |
Extract inexpensive information from a Title object for return to Lua.
Definition at line 60 of file TitleLibrary.php.
References $title, Title\equals(), SpecialPageFactory\exists(), Scribunto_LuaLibraryBase\getParser(), Scribunto_LuaLibraryBase\getTitle(), NS_FILE, NS_MEDIA, and NS_SPECIAL.
Referenced by makeTitle(), newTitle(), redirectTarget(), and register().
Scribunto_LuaTitleLibrary::getUrl | ( | $text, | |
$which, | |||
$query = null , |
|||
$proto = null |
|||
) |
Get a URL referring to this title.
Definition at line 222 of file TitleLibrary.php.
References $args, $title, Scribunto_LuaLibraryBase\checkType(), Scribunto_LuaLibraryBase\checkTypeOptional(), Title\newFromText(), PROTO_CANONICAL, PROTO_HTTP, PROTO_HTTPS, and PROTO_RELATIVE.
|
staticprivate |
Definition at line 352 of file TitleLibrary.php.
Referenced by cascadingProtection().
Scribunto_LuaTitleLibrary::makeTitle | ( | $ns, | |
$text, | |||
$fragment = null , |
|||
$interwiki = null |
|||
) |
Handler for title.makeTitle.
Calls Title::makeTitleSafe.
Definition at line 197 of file TitleLibrary.php.
References $title, checkNamespace(), Scribunto_LuaLibraryBase\checkType(), Scribunto_LuaLibraryBase\checkTypeOptional(), getInexpensiveTitleData(), and Title\makeTitleSafe().
Scribunto_LuaTitleLibrary::newTitle | ( | $text_or_id, | |
$defaultNamespace = null |
|||
) |
Handler for title.new.
Calls Title::newFromID or Title::newFromTitle as appropriate for the arguments.
Definition at line 148 of file TitleLibrary.php.
References $title, $type, checkNamespace(), Scribunto_LuaLibraryBase\checkType(), getInexpensiveTitleData(), Scribunto_LuaLibraryBase\getLuaType(), Scribunto_LuaLibraryBase\getParser(), Scribunto_LuaLibraryBase\incrementExpensiveFunctionCount(), Title\newFromID(), Title\newFromText(), and NS_MAIN.
Scribunto_LuaTitleLibrary::protectionLevels | ( | $text | ) |
Handler for protectionLevels.
Definition at line 365 of file TitleLibrary.php.
References $title, Scribunto_LuaLibraryBase\checkType(), Scribunto_LuaLibraryBase\incrementExpensiveFunctionCount(), and Title\newFromText().
Scribunto_LuaTitleLibrary::redirectTarget | ( | $text | ) |
Handler for redirectTarget.
Definition at line 413 of file TitleLibrary.php.
References $content, Scribunto_LuaLibraryBase\checkType(), getContentInternal(), and getInexpensiveTitleData().
Scribunto_LuaTitleLibrary::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.
Reimplemented from Scribunto_LuaLibraryBase.
Definition at line 11 of file TitleLibrary.php.
References Scribunto_LuaLibraryBase\getEngine(), getInexpensiveTitleData(), Scribunto_LuaLibraryBase\getTitle(), and NS_MEDIA.
|
private |
Definition at line 9 of file TitleLibrary.php.
|
private |
Definition at line 8 of file TitleLibrary.php.