MediaWiki
REL1_32
NamespaceImportTitleFactory.php
Go to the documentation of this file.
1
<?php
26
class
NamespaceImportTitleFactory
implements
ImportTitleFactory
{
28
protected
$ns
;
29
33
public
function
__construct
(
$ns
) {
34
if
( !MWNamespace::exists(
$ns
) ) {
35
throw
new
MWException
(
"Namespace $ns doesn't exist on this wiki"
);
36
}
37
$this->ns =
$ns
;
38
}
39
48
public
function
createTitleFromForeignTitle
(
ForeignTitle
$foreignTitle ) {
49
return
Title::makeTitleSafe( $this->ns, $foreignTitle->getText() );
50
}
51
}
ForeignTitle
A simple, immutable structure to hold the title of a page on a foreign MediaWiki installation.
Definition
ForeignTitle.php:28
MWException
MediaWiki exception.
Definition
MWException.php:26
NamespaceImportTitleFactory
A class to convert page titles on a foreign wiki (ForeignTitle objects) into page titles on the local...
Definition
NamespaceImportTitleFactory.php:26
NamespaceImportTitleFactory\$ns
int $ns
Definition
NamespaceImportTitleFactory.php:28
NamespaceImportTitleFactory\__construct
__construct( $ns)
Definition
NamespaceImportTitleFactory.php:33
NamespaceImportTitleFactory\createTitleFromForeignTitle
createTitleFromForeignTitle(ForeignTitle $foreignTitle)
Determines which local title best corresponds to the given foreign title.
Definition
NamespaceImportTitleFactory.php:48
ImportTitleFactory
Represents an object that can convert page titles on a foreign wiki (ForeignTitle objects) into page ...
Definition
ImportTitleFactory.php:25
includes
title
NamespaceImportTitleFactory.php
Generated on Mon Nov 25 2024 15:57:51 for MediaWiki by
1.10.0