| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
namespace MediaWiki\Cache; |
| 25 |
|
| 26 |
use MediaWiki\Language\Language; |
| 27 |
use MediaWiki\Linker\LinksMigration; |
| 28 |
use MediaWiki\Linker\LinkTarget; |
| 29 |
use MediaWiki\Page\PageReference; |
| 30 |
use MediaWiki\Title\TitleFormatter; |
| 31 |
use Psr\Log\LoggerInterface; |
| 32 |
use Wikimedia\Rdbms\IConnectionProvider; |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
class LinkBatchFactory { |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
private $linkCache; |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
private $titleFormatter; |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
private $contentLanguage; |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
private $genderCache; |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
private $dbProvider; |
| 64 |
|
| 65 |
|
| 66 |
private $linksMigration; |
| 67 |
|
| 68 |
|
| 69 |
private $logger; |
| 70 |
|
| 71 |
public function __construct( |
| 72 |
LinkCache $linkCache, |
| 73 |
TitleFormatter $titleFormatter, |
| 74 |
Language $contentLanguage, |
| 75 |
GenderCache $genderCache, |
| 76 |
IConnectionProvider $dbProvider, |
| 77 |
LinksMigration $linksMigration, |
| 78 |
LoggerInterface $logger |
| 79 |
) { |
| 80 |
$this->linkCache = $linkCache; |
| 81 |
$this->titleFormatter = $titleFormatter; |
| 82 |
$this->contentLanguage = $contentLanguage; |
| 83 |
$this->genderCache = $genderCache; |
| 84 |
$this->dbProvider = $dbProvider; |
| 85 |
$this->linksMigration = $linksMigration; |
| 86 |
$this->logger = $logger; |
| 87 |
} |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
public function newLinkBatch( iterable $initialItems = [] ): LinkBatch { |
| 95 |
return new LinkBatch( |
| 96 |
$initialItems, |
| 97 |
$this->linkCache, |
| 98 |
$this->titleFormatter, |
| 99 |
$this->contentLanguage, |
| 100 |
$this->genderCache, |
| 101 |
$this->dbProvider, |
| 102 |
$this->linksMigration, |
| 103 |
$this->logger |
| 104 |
); |
| 105 |
} |
| 106 |
} |