3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
21 namespace MediaWiki\Export
;
23 use MediaWiki\CommentStore\CommentStore
;
24 use MediaWiki\HookContainer\HookContainer
;
25 use MediaWiki\Revision\RevisionStore
;
26 use MediaWiki\Title\TitleParser
;
28 use Wikimedia\Rdbms\IReadableDatabase
;
31 * Factory service for WikiExporter instances.
36 class WikiExporterFactory
{
37 /** @var HookContainer */
38 private $hookContainer;
40 /** @var RevisionStore */
41 private $revisionStore;
43 /** @var TitleParser */
46 /** @var CommentStore */
47 private $commentStore;
50 * @param HookContainer $hookContainer
51 * @param RevisionStore $revisionStore
52 * @param TitleParser $titleParser
53 * @param CommentStore $commentStore
55 public function __construct(
56 HookContainer
$hookContainer,
57 RevisionStore
$revisionStore,
58 TitleParser
$titleParser,
59 CommentStore
$commentStore
61 $this->hookContainer
= $hookContainer;
62 $this->revisionStore
= $revisionStore;
63 $this->titleParser
= $titleParser;
64 $this->commentStore
= $commentStore;
68 * @param IReadableDatabase $db
69 * @param int|array $history
71 * @param null|array $limitNamespaces
73 * @return WikiExporter
75 public function getWikiExporter(
76 IReadableDatabase
$db,
77 $history = WikiExporter
::CURRENT
,
78 $text = WikiExporter
::TEXT
,
79 $limitNamespaces = null
81 return new WikiExporter(