MediaWiki REL1_31
BlobStoreFactory.php
Go to the documentation of this file.
1<?php
21namespace MediaWiki\Storage;
22
23use Config;
24use Language;
27
36
41
45 private $cache;
46
50 private $config;
51
55 private $contLang;
56
57 public function __construct(
60 Config $mainConfig,
62 ) {
63 $this->loadBalancer = $loadBalancer;
64 $this->cache = $cache;
65 $this->config = $mainConfig;
66 $this->contLang = $contLang;
67 }
68
76 public function newBlobStore( $wikiId = false ) {
77 return $this->newSqlBlobStore( $wikiId );
78 }
79
87 public function newSqlBlobStore( $wikiId = false ) {
88 $store = new SqlBlobStore(
89 $this->loadBalancer,
90 $this->cache,
91 $wikiId
92 );
93
94 $store->setCompressBlobs( $this->config->get( 'CompressRevisions' ) );
95 $store->setCacheExpiry( $this->config->get( 'RevisionCacheExpiry' ) );
96 $store->setUseExternalStore( $this->config->get( 'DefaultExternalStore' ) !== false );
97
98 if ( $this->config->get( 'LegacyEncoding' ) ) {
99 $store->setLegacyEncoding( $this->config->get( 'LegacyEncoding' ), $this->contLang );
100 }
101
102 return $store;
103 }
104
105}
Internationalisation code.
Definition Language.php:35
Service for instantiating BlobStores.
__construct(LoadBalancer $loadBalancer, WANObjectCache $cache, Config $mainConfig, Language $contLang)
Service for storing and loading Content objects.
Multi-datacenter aware caching interface.
Database connection, tracking, load balancing, and transaction manager for a cluster.
Interface for configuration instances.
Definition Config.php:28
you have access to all of the normal MediaWiki so you can get a DB use the cache