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