34 private $contentLanguage;
37 private $namespaceInfo;
40 private $titleFactory;
52 $this->contentLanguage = $contentLanguage;
53 $this->namespaceInfo = $namespaceInfo;
54 $this->titleFactory = $titleFactory;
73 $this->namespaceInfo->exists( $foreignNs )
75 return $this->titleFactory->makeTitleSafe( $foreignNs, $foreignTitle->
getText() );
81 $targetNs = $this->contentLanguage->getNsIndex( $foreignTitle->
getNamespaceName() );
82 if ( $targetNs !==
false ) {
83 return $this->titleFactory->makeTitleSafe( $targetNs, $foreignTitle->
getText() );
87 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 ...