MediaWiki master
WikiImporterFactory.php
Go to the documentation of this file.
1<?php
32
39 private Config $config;
40 private HookContainer $hookContainer;
41 private Language $contentLanguage;
42 private NamespaceInfo $namespaceInfo;
43 private TitleFactory $titleFactory;
44 private WikiPageFactory $wikiPageFactory;
45 private UploadRevisionImporter $uploadRevisionImporter;
46 private IContentHandlerFactory $contentHandlerFactory;
47 private SlotRoleRegistry $slotRoleRegistry;
48
49 public function __construct(
50 Config $config,
51 HookContainer $hookContainer,
52 Language $contentLanguage,
53 NamespaceInfo $namespaceInfo,
54 TitleFactory $titleFactory,
55 WikiPageFactory $wikiPageFactory,
56 UploadRevisionImporter $uploadRevisionImporter,
57 IContentHandlerFactory $contentHandlerFactory,
58 SlotRoleRegistry $slotRoleRegistry
59 ) {
60 $this->config = $config;
61 $this->hookContainer = $hookContainer;
62 $this->contentLanguage = $contentLanguage;
63 $this->namespaceInfo = $namespaceInfo;
64 $this->titleFactory = $titleFactory;
65 $this->wikiPageFactory = $wikiPageFactory;
66 $this->uploadRevisionImporter = $uploadRevisionImporter;
67 $this->contentHandlerFactory = $contentHandlerFactory;
68 $this->slotRoleRegistry = $slotRoleRegistry;
69 }
70
82 public function getWikiImporter( ImportSource $source, ?Authority $performer = null ): WikiImporter {
83 if ( !$performer ) {
84 wfDeprecated( __METHOD__ . ' without $performer', '1.42' );
85 $performer = RequestContext::getMain()->getAuthority();
86 }
87
88 return new WikiImporter(
89 $source,
90 $performer,
91 $this->config,
92 $this->hookContainer,
93 $this->contentLanguage,
94 $this->namespaceInfo,
95 $this->titleFactory,
96 $this->wikiPageFactory,
97 $this->uploadRevisionImporter,
98 $this->contentHandlerFactory,
99 $this->slotRoleRegistry
100 );
101 }
102}
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
if(!defined('MW_SETUP_CALLBACK'))
Definition WebStart.php:81
Group all the pieces relevant to the context of a request into one instance.
Base class for language-specific code.
Definition Language.php:78
Service for creating WikiPage objects.
A registry service for SlotRoleHandlers, used to define which slot roles are available on which page.
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Creates Title objects.
Factory service for WikiImporter instances.
getWikiImporter(ImportSource $source, ?Authority $performer=null)
__construct(Config $config, HookContainer $hookContainer, Language $contentLanguage, NamespaceInfo $namespaceInfo, TitleFactory $titleFactory, WikiPageFactory $wikiPageFactory, UploadRevisionImporter $uploadRevisionImporter, IContentHandlerFactory $contentHandlerFactory, SlotRoleRegistry $slotRoleRegistry)
XML file reader for the page data importer.
Source interface for XML import.
Interface for configuration instances.
Definition Config.php:32
This interface represents the authority associated with the current execution context,...
Definition Authority.php:37
$source