X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FStorage%2FBlobStoreFactory.php;h=b59c68d175a94128718fc7bb050cd606d29a9bbe;hb=8fc57e9555b704edf883e828878f0120d85a7b1c;hp=5e994540aae3105a65c96581b1b824e26a543141;hpb=6f3786a57d6a27befcb8f04281e2786ace6a1dc3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Storage/BlobStoreFactory.php b/includes/Storage/BlobStoreFactory.php index 5e994540aa..b59c68d175 100644 --- a/includes/Storage/BlobStoreFactory.php +++ b/includes/Storage/BlobStoreFactory.php @@ -23,7 +23,8 @@ namespace MediaWiki\Storage; use Language; use MediaWiki\Config\ServiceOptions; use WANObjectCache; -use Wikimedia\Rdbms\LBFactory; +use Wikimedia\Rdbms\ILBFactory; +use ExternalStoreAccess; /** * Service for instantiating BlobStores @@ -35,10 +36,15 @@ use Wikimedia\Rdbms\LBFactory; class BlobStoreFactory { /** - * @var LBFactory + * @var ILBFactory */ private $lbFactory; + /** + * @var ExternalStoreAccess + */ + private $extStoreAccess; + /** * @var WANObjectCache */ @@ -68,7 +74,8 @@ class BlobStoreFactory { ]; public function __construct( - LBFactory $lbFactory, + ILBFactory $lbFactory, + ExternalStoreAccess $extStoreAccess, WANObjectCache $cache, ServiceOptions $options, Language $contLang @@ -76,6 +83,7 @@ class BlobStoreFactory { $options->assertRequiredOptions( self::$constructorOptions ); $this->lbFactory = $lbFactory; + $this->extStoreAccess = $extStoreAccess; $this->cache = $cache; $this->options = $options; $this->contLang = $contLang; @@ -84,27 +92,28 @@ class BlobStoreFactory { /** * @since 1.31 * - * @param bool|string $wikiId The ID of the target wiki database. Use false for the local wiki. + * @param bool|string $dbDomain The ID of the target wiki database. Use false for the local wiki. * * @return BlobStore */ - public function newBlobStore( $wikiId = false ) { - return $this->newSqlBlobStore( $wikiId ); + public function newBlobStore( $dbDomain = false ) { + return $this->newSqlBlobStore( $dbDomain ); } /** * @internal Please call newBlobStore and use the BlobStore interface. * - * @param bool|string $wikiId The ID of the target wiki database. Use false for the local wiki. + * @param bool|string $dbDomain The ID of the target wiki database. Use false for the local wiki. * * @return SqlBlobStore */ - public function newSqlBlobStore( $wikiId = false ) { - $lb = $this->lbFactory->getMainLB( $wikiId ); + public function newSqlBlobStore( $dbDomain = false ) { + $lb = $this->lbFactory->getMainLB( $dbDomain ); $store = new SqlBlobStore( $lb, + $this->extStoreAccess, $this->cache, - $wikiId + $dbDomain ); $store->setCompressBlobs( $this->options->get( 'CompressRevisions' ) );