MediaWiki REL1_34
|
Public Member Functions | |
cascadingProtection ( $text) | |
Handler for cascadingProtection. | |
getContent ( $text) | |
Handler for getContent. | |
getExpensiveData ( $text) | |
Extract expensive information from a Title object for return to Lua. | |
getFileInfo ( $text) | |
Handler for getFileInfo. | |
getUrl ( $text, $which, $query=null, $proto=null) | |
Get a URL referring to this title. | |
makeTitle ( $ns, $text, $fragment=null, $interwiki=null) | |
Handler for title.makeTitle. | |
newTitle ( $text_or_id, $defaultNamespace=null) | |
Handler for title.new. | |
protectionLevels ( $text) | |
Handler for protectionLevels. | |
redirectTarget ( $text) | |
Handler for redirectTarget. | |
register () | |
Called to register the library. | |
Public Member Functions inherited from Scribunto_LuaLibraryBase | |
__construct (Scribunto_LuaEngine $engine) | |
incrementExpensiveFunctionCount () | |
Increment the expensive function count, and throw if limit exceeded. | |
Private Member Functions | |
checkNamespace ( $name, $argIdx, &$arg, $default=null) | |
getContentInternal ( $text) | |
Utility to get a Content object from a title. | |
getInexpensiveTitleData (Title $title) | |
Extract inexpensive information from a Title object for return to Lua. | |
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. | |
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. | |
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(), and makeArrayOneBased().
|
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(), 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(), Scribunto_LuaLibraryBase\getParser(), Scribunto_LuaLibraryBase\incrementExpensiveFunctionCount(), 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(), 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(), 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(), 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(), and getInexpensiveTitleData().
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(), and NS_MAIN.
Scribunto_LuaTitleLibrary::protectionLevels | ( | $text | ) |
Handler for protectionLevels.
Definition at line 365 of file TitleLibrary.php.
References $title, Scribunto_LuaLibraryBase\checkType(), and Scribunto_LuaLibraryBase\incrementExpensiveFunctionCount().
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.