MediaWiki master
|
A class to convert page titles on a foreign wiki (ForeignTitle objects) into page titles on the local wiki (Title objects), using a default namespace mapping. More...
Inherits MediaWiki\Title\ImportTitleFactory.
Public Member Functions | |
__construct (Language $contentLanguage, NamespaceInfo $namespaceInfo, TitleFactory $titleFactory) | |
createTitleFromForeignTitle (ForeignTitle $foreignTitle) | |
Determines which local title best corresponds to the given foreign title. | |
A class to convert page titles on a foreign wiki (ForeignTitle objects) into page titles on the local wiki (Title objects), using a default namespace mapping.
For built-in namespaces (0 <= ID < 100), we try to find a local namespace with the same namespace ID as the foreign page. If no such namespace exists, or the namespace ID is unknown or > 100, we look for a local namespace with a matching namespace name. If that can't be found, we dump the page in the main namespace as a last resort.
Definition at line 36 of file NaiveImportTitleFactory.php.
MediaWiki\Title\NaiveImportTitleFactory::__construct | ( | Language | $contentLanguage, |
NamespaceInfo | $namespaceInfo, | ||
TitleFactory | $titleFactory ) |
Definition at line 41 of file NaiveImportTitleFactory.php.
MediaWiki\Title\NaiveImportTitleFactory::createTitleFromForeignTitle | ( | ForeignTitle | $foreignTitle | ) |
Determines which local title best corresponds to the given foreign title.
If such a title can't be found or would be locally invalid, null is returned.
ForeignTitle | $foreignTitle | The ForeignTitle to convert |
Implements MediaWiki\Title\ImportTitleFactory.
Definition at line 59 of file NaiveImportTitleFactory.php.
References MediaWiki\Title\ForeignTitle\getFullText(), MediaWiki\Title\ForeignTitle\getNamespaceId(), MediaWiki\Title\ForeignTitle\getNamespaceName(), MediaWiki\Title\ForeignTitle\getText(), and MediaWiki\Title\ForeignTitle\isNamespaceIdKnown().