MediaWiki
REL1_31
BlobStoreFactory.php
Go to the documentation of this file.
1
<?php
21
namespace
MediaWiki\Storage
;
22
23
use
Config
;
24
use
Language
;
25
use
WANObjectCache
;
26
use
Wikimedia\Rdbms\LoadBalancer
;
27
35
class
BlobStoreFactory
{
36
40
private
$loadBalancer
;
41
45
private
$cache
;
46
50
private
$config
;
51
55
private
$contLang
;
56
57
public
function
__construct
(
58
LoadBalancer
$loadBalancer
,
59
WANObjectCache
$cache
,
60
Config
$mainConfig,
61
Language
$contLang
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
}
Language
Internationalisation code.
Definition
Language.php:35
MediaWiki\Storage\BlobStoreFactory
Service for instantiating BlobStores.
Definition
BlobStoreFactory.php:35
MediaWiki\Storage\BlobStoreFactory\$cache
WANObjectCache $cache
Definition
BlobStoreFactory.php:45
MediaWiki\Storage\BlobStoreFactory\$config
Config $config
Definition
BlobStoreFactory.php:50
MediaWiki\Storage\BlobStoreFactory\newSqlBlobStore
newSqlBlobStore( $wikiId=false)
Definition
BlobStoreFactory.php:87
MediaWiki\Storage\BlobStoreFactory\$loadBalancer
LoadBalancer $loadBalancer
Definition
BlobStoreFactory.php:40
MediaWiki\Storage\BlobStoreFactory\__construct
__construct(LoadBalancer $loadBalancer, WANObjectCache $cache, Config $mainConfig, Language $contLang)
Definition
BlobStoreFactory.php:57
MediaWiki\Storage\BlobStoreFactory\$contLang
Language $contLang
Definition
BlobStoreFactory.php:55
MediaWiki\Storage\BlobStoreFactory\newBlobStore
newBlobStore( $wikiId=false)
Definition
BlobStoreFactory.php:76
MediaWiki\Storage\SqlBlobStore
Service for storing and loading Content objects.
Definition
SqlBlobStore.php:50
WANObjectCache
Multi-datacenter aware caching interface.
Definition
WANObjectCache.php:87
Wikimedia\Rdbms\LoadBalancer
Database connection, tracking, load balancing, and transaction manager for a cluster.
Definition
LoadBalancer.php:41
Config
Interface for configuration instances.
Definition
Config.php:28
cache
you have access to all of the normal MediaWiki so you can get a DB use the cache
Definition
maintenance.txt:55
MediaWiki\Storage
Definition
BlobAccessException.php:23
includes
Storage
BlobStoreFactory.php
Generated on Mon Nov 25 2024 15:35:31 for MediaWiki by
1.10.0