37 private $contentLanguage;
40 private $namespaceInfo;
43 private $titleFactory;
55 $this->contentLanguage = $contentLanguage;
56 $this->namespaceInfo = $namespaceInfo;
57 $this->titleFactory = $titleFactory;
76 $this->namespaceInfo->exists( $foreignNs )
78 return $this->titleFactory->makeTitleSafe( $foreignNs, $foreignTitle->
getText() );
84 $targetNs = $this->contentLanguage->getNsIndex( $foreignTitle->
getNamespaceName() );
85 if ( $targetNs !==
false ) {
86 return $this->titleFactory->makeTitleSafe( $targetNs, $foreignTitle->
getText() );
90 return $this->titleFactory->makeTitleSafe( 0, $foreignTitle->
getFullText() );
A simple, immutable structure to hold the title of a page on a foreign MediaWiki installation.
isNamespaceIdKnown()
Do we know the namespace ID of the page on the foreign wiki?
Base class for language-specific code.
A class to convert page titles on a foreign wiki (ForeignTitle objects) into page titles on the local...
__construct(Language $contentLanguage, NamespaceInfo $namespaceInfo, TitleFactory $titleFactory)
createTitleFromForeignTitle(ForeignTitle $foreignTitle)
Determines which local title best corresponds to the given foreign title.
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Represents an object that can convert page titles on a foreign wiki (ForeignTitle objects) into page ...