MediaWiki
1.28.0
|
A parser that translates page titles on a foreign wiki into ForeignTitle objects, with no knowledge of the namespace setup on the foreign site. More...
Public Member Functions | |
createForeignTitle ($title, $ns=null) | |
Creates a ForeignTitle object based on the page title, and optionally the namespace ID, of a page on a foreign wiki. More... | |
A parser that translates page titles on a foreign wiki into ForeignTitle objects, with no knowledge of the namespace setup on the foreign site.
Definition at line 26 of file NaiveForeignTitleFactory.php.
NaiveForeignTitleFactory::createForeignTitle | ( | $title, | |
$ns = null |
|||
) |
Creates a ForeignTitle object based on the page title, and optionally the namespace ID, of a page on a foreign wiki.
These values could be, for example, the <title> and <ns> attributes found in an XML dump.
Although exported XML dumps have contained a map of namespace IDs to names since MW 1.5, the importer used to completely ignore the <siteinfo> tag before MW 1.25. It is therefore possible that custom XML dumps (i.e. not generated by Special:Export) have been created without this metadata. As a result, this code falls back to using namespace data for the local wiki (similar to buggy pre-1.25 behaviour) if $ns is not supplied.
string | $title | The page title |
int | null | $ns | The namespace ID, or null if this data is not available |
Implements ForeignTitleFactory.
Definition at line 43 of file NaiveForeignTitleFactory.php.
References $title, $wgContLang, false, global, and list.