MediaWiki
REL1_32
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\LBFactory
;
27
35
class
BlobStoreFactory
{
36
40
private
$lbFactory
;
41
45
private
$cache
;
46
50
private
$config
;
51
55
private
$contLang
;
56
57
public
function
__construct
(
58
LBFactory
$lbFactory
,
59
WANObjectCache
$cache
,
60
Config
$mainConfig,
61
Language
$contLang
62
) {
63
$this->lbFactory =
$lbFactory
;
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
$lb = $this->lbFactory->getMainLB( $wikiId );
89
$store =
new
SqlBlobStore
(
90
$lb,
91
$this->
cache
,
92
$wikiId
93
);
94
95
$store->setCompressBlobs( $this->config->get(
'CompressRevisions'
) );
96
$store->setCacheExpiry( $this->config->get(
'RevisionCacheExpiry'
) );
97
$store->setUseExternalStore( $this->config->get(
'DefaultExternalStore'
) !==
false
);
98
99
if
( $this->config->get(
'LegacyEncoding'
) ) {
100
$store->setLegacyEncoding( $this->config->get(
'LegacyEncoding'
), $this->contLang );
101
}
102
103
return
$store;
104
}
105
106
}
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\__construct
__construct(LBFactory $lbFactory, 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\BlobStoreFactory\$lbFactory
LBFactory $lbFactory
Definition
BlobStoreFactory.php:40
MediaWiki\Storage\SqlBlobStore
Service for storing and loading Content objects.
Definition
SqlBlobStore.php:50
WANObjectCache
Multi-datacenter aware caching interface.
Definition
WANObjectCache.php:118
Wikimedia\Rdbms\LBFactory
An interface for generating database load balancers.
Definition
LBFactory.php:39
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:57:49 for MediaWiki by
1.10.0