| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
namespace MediaWiki\Export; |
| 22 |
|
| 23 |
use MediaWiki\CommentStore\CommentStore; |
| 24 |
use MediaWiki\HookContainer\HookContainer; |
| 25 |
use MediaWiki\Revision\RevisionStore; |
| 26 |
use MediaWiki\Title\TitleParser; |
| 27 |
use WikiExporter; |
| 28 |
use Wikimedia\Rdbms\IReadableDatabase; |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
class WikiExporterFactory { |
| 37 |
|
| 38 |
private $hookContainer; |
| 39 |
|
| 40 |
|
| 41 |
private $revisionStore; |
| 42 |
|
| 43 |
|
| 44 |
private $titleParser; |
| 45 |
|
| 46 |
|
| 47 |
private $commentStore; |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
public function __construct( |
| 56 |
HookContainer $hookContainer, |
| 57 |
RevisionStore $revisionStore, |
| 58 |
TitleParser $titleParser, |
| 59 |
CommentStore $commentStore |
| 60 |
) { |
| 61 |
$this->hookContainer = $hookContainer; |
| 62 |
$this->revisionStore = $revisionStore; |
| 63 |
$this->titleParser = $titleParser; |
| 64 |
$this->commentStore = $commentStore; |
| 65 |
} |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
public function getWikiExporter( |
| 76 |
IReadableDatabase $db, |
| 77 |
$history = WikiExporter::CURRENT, |
| 78 |
$text = WikiExporter::TEXT, |
| 79 |
$limitNamespaces = null |
| 80 |
): WikiExporter { |
| 81 |
return new WikiExporter( |
| 82 |
$db, |
| 83 |
$this->commentStore, |
| 84 |
$this->hookContainer, |
| 85 |
$this->revisionStore, |
| 86 |
$this->titleParser, |
| 87 |
$history, |
| 88 |
$text, |
| 89 |
$limitNamespaces |
| 90 |
); |
| 91 |
} |
| 92 |
} |