dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Services: Convert BlobStoreFactory's static to a const now HHVM is gone
[lhc/web/wiklou.git]
/
includes
/
Storage
/
BlobStoreFactory.php
diff --git
a/includes/Storage/BlobStoreFactory.php
b/includes/Storage/BlobStoreFactory.php
index
5e99454
..
c1371c9
100644
(file)
--- 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 Language;
use MediaWiki\Config\ServiceOptions;
use WANObjectCache;
-use Wikimedia\Rdbms\LBFactory;
+use Wikimedia\Rdbms\ILBFactory;
+use ExternalStoreAccess;
/**
* Service for instantiating BlobStores
/**
* Service for instantiating BlobStores
@@
-35,10
+36,15
@@
use Wikimedia\Rdbms\LBFactory;
class BlobStoreFactory {
/**
class BlobStoreFactory {
/**
- * @var LBFactory
+ * @var
I
LBFactory
*/
private $lbFactory;
*/
private $lbFactory;
+ /**
+ * @var ExternalStoreAccess
+ */
+ private $extStoreAccess;
+
/**
* @var WANObjectCache
*/
/**
* @var WANObjectCache
*/
@@
-55,12
+61,10
@@
class BlobStoreFactory {
private $contLang;
/**
private $contLang;
/**
- * TODO Make this a const when HHVM support is dropped (T192166)
- *
* @var array
* @since 1.34
*/
* @var array
* @since 1.34
*/
- public
static $constructorOptions
= [
+ public
const CONSTRUCTOR_OPTIONS
= [
'CompressRevisions',
'DefaultExternalStore',
'LegacyEncoding',
'CompressRevisions',
'DefaultExternalStore',
'LegacyEncoding',
@@
-68,14
+72,16
@@
class BlobStoreFactory {
];
public function __construct(
];
public function __construct(
- LBFactory $lbFactory,
+ ILBFactory $lbFactory,
+ ExternalStoreAccess $extStoreAccess,
WANObjectCache $cache,
ServiceOptions $options,
Language $contLang
) {
WANObjectCache $cache,
ServiceOptions $options,
Language $contLang
) {
- $options->assertRequiredOptions( self::
$constructorOptions
);
+ $options->assertRequiredOptions( self::
CONSTRUCTOR_OPTIONS
);
$this->lbFactory = $lbFactory;
$this->lbFactory = $lbFactory;
+ $this->extStoreAccess = $extStoreAccess;
$this->cache = $cache;
$this->options = $options;
$this->contLang = $contLang;
$this->cache = $cache;
$this->options = $options;
$this->contLang = $contLang;
@@
-84,27
+90,28
@@
class BlobStoreFactory {
/**
* @since 1.31
*
/**
* @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
*/
*
* @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.
*
}
/**
* @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
*/
*
* @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,
$store = new SqlBlobStore(
$lb,
+ $this->extStoreAccess,
$this->cache,
$this->cache,
- $
wikiId
+ $
dbDomain
);
$store->setCompressBlobs( $this->options->get( 'CompressRevisions' ) );
);
$store->setCompressBlobs( $this->options->get( 'CompressRevisions' ) );