MediaWiki master
WikiImporterFactory.php
Go to the documentation of this file.
1<?php
31
38 private Config $config;
39 private HookContainer $hookContainer;
40 private Language $contentLanguage;
41 private NamespaceInfo $namespaceInfo;
42 private TitleFactory $titleFactory;
43 private WikiPageFactory $wikiPageFactory;
44 private UploadRevisionImporter $uploadRevisionImporter;
45 private IContentHandlerFactory $contentHandlerFactory;
46 private SlotRoleRegistry $slotRoleRegistry;
47
48 public function __construct(
49 Config $config,
50 HookContainer $hookContainer,
51 Language $contentLanguage,
52 NamespaceInfo $namespaceInfo,
53 TitleFactory $titleFactory,
54 WikiPageFactory $wikiPageFactory,
55 UploadRevisionImporter $uploadRevisionImporter,
56 IContentHandlerFactory $contentHandlerFactory,
57 SlotRoleRegistry $slotRoleRegistry
58 ) {
59 $this->config = $config;
60 $this->hookContainer = $hookContainer;
61 $this->contentLanguage = $contentLanguage;
62 $this->namespaceInfo = $namespaceInfo;
63 $this->titleFactory = $titleFactory;
64 $this->wikiPageFactory = $wikiPageFactory;
65 $this->uploadRevisionImporter = $uploadRevisionImporter;
66 $this->contentHandlerFactory = $contentHandlerFactory;
67 $this->slotRoleRegistry = $slotRoleRegistry;
68 }
69
81 public function getWikiImporter( ImportSource $source, Authority $performer = null ): WikiImporter {
82 if ( !$performer ) {
83 wfDeprecated( __METHOD__ . ' without $performer', '1.42' );
84 $performer = RequestContext::getMain()->getAuthority();
85 }
86
87 return new WikiImporter(
88 $source,
89 $performer,
90 $this->config,
91 $this->hookContainer,
92 $this->contentLanguage,
93 $this->namespaceInfo,
94 $this->titleFactory,
95 $this->wikiPageFactory,
96 $this->uploadRevisionImporter,
97 $this->contentHandlerFactory,
98 $this->slotRoleRegistry
99 );
100 }
101}
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
Base class for language-specific code.
Definition Language.php:65
Group all the pieces relevant to the context of a request into one instance.
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