MediaWiki  master
SqlBlobStore.php
Go to the documentation of this file.
1 <?php
27 namespace MediaWiki\Storage;
28 
29 use AppendIterator;
32 use IDBAccessObject;
33 use IExpiringStore;
34 use InvalidArgumentException;
35 use MWException;
36 use StatusValue;
37 use WANObjectCache;
38 use Wikimedia\Assert\Assert;
39 use Wikimedia\AtEase\AtEase;
42 
52 
53  // Note: the name has been taken unchanged from the Revision class.
54  public const TEXT_CACHE_GROUP = 'revisiontext:10';
55 
59  private $dbLoadBalancer;
60 
64  private $extStoreAccess;
65 
69  private $cache;
70 
74  private $dbDomain;
75 
79  private $cacheExpiry = 604800; // 7 days
80 
84  private $compressBlobs = false;
85 
89  private $legacyEncoding = false;
90 
94  private $useExternalStore = false;
95 
107  public function __construct(
111  $dbDomain = false
112  ) {
113  $this->dbLoadBalancer = $dbLoadBalancer;
114  $this->extStoreAccess = $extStoreAccess;
115  $this->cache = $cache;
116  $this->dbDomain = $dbDomain;
117  }
118 
122  public function getCacheExpiry() {
123  return $this->cacheExpiry;
124  }
125 
129  public function setCacheExpiry( $cacheExpiry ) {
130  Assert::parameterType( 'integer', $cacheExpiry, '$cacheExpiry' );
131 
132  $this->cacheExpiry = $cacheExpiry;
133  }
134 
138  public function getCompressBlobs() {
139  return $this->compressBlobs;
140  }
141 
145  public function setCompressBlobs( $compressBlobs ) {
146  $this->compressBlobs = $compressBlobs;
147  }
148 
153  public function getLegacyEncoding() {
154  return $this->legacyEncoding;
155  }
156 
162  wfDeprecated( __METHOD__ );
163  return null;
164  }
165 
174  public function setLegacyEncoding( $legacyEncoding ) {
175  Assert::parameterType( 'string', $legacyEncoding, '$legacyEncoding' );
176 
177  $this->legacyEncoding = $legacyEncoding;
178  }
179 
183  public function getUseExternalStore() {
185  }
186 
191  Assert::parameterType( 'boolean', $useExternalStore, '$useExternalStore' );
192 
193  $this->useExternalStore = $useExternalStore;
194  }
195 
199  private function getDBLoadBalancer() {
200  return $this->dbLoadBalancer;
201  }
202 
208  private function getDBConnection( $index ) {
209  $lb = $this->getDBLoadBalancer();
210  return $lb->getConnectionRef( $index, [], $this->dbDomain );
211  }
212 
223  public function storeBlob( $data, $hints = [] ) {
224  try {
225  $flags = $this->compressData( $data );
226 
227  # Write to external storage if required
228  if ( $this->useExternalStore ) {
229  // Store and get the URL
230  $data = $this->extStoreAccess->insert( $data, [ 'domain' => $this->dbDomain ] );
231  if ( !$data ) {
232  throw new BlobAccessException( "Failed to store text to external storage" );
233  }
234  if ( $flags ) {
235  $flags .= ',';
236  }
237  $flags .= 'external';
238 
239  // TODO: we could also return an address for the external store directly here.
240  // That would mean bypassing the text table entirely when the external store is
241  // used. We'll need to assess expected fallout before doing that.
242  }
243 
244  $dbw = $this->getDBConnection( DB_MASTER );
245 
246  $old_id = $dbw->nextSequenceValue( 'text_old_id_seq' );
247  $dbw->insert(
248  'text',
249  [
250  'old_id' => $old_id,
251  'old_text' => $data,
252  'old_flags' => $flags,
253  ],
254  __METHOD__
255  );
256 
257  $textId = $dbw->insertId();
258 
259  return self::makeAddressFromTextId( $textId );
260  } catch ( MWException $e ) {
261  throw new BlobAccessException( $e->getMessage(), 0, $e );
262  }
263  }
264 
277  public function getBlob( $blobAddress, $queryFlags = 0 ) {
278  Assert::parameterType( 'string', $blobAddress, '$blobAddress' );
279 
280  $error = null;
281  $blob = $this->cache->getWithSetCallback(
282  $this->getCacheKey( $blobAddress ),
283  $this->getCacheTTL(),
284  function ( $unused, &$ttl, &$setOpts ) use ( $blobAddress, $queryFlags, &$error ) {
285  // Ignore $setOpts; blobs are immutable and negatives are not cached
286  list( $result, $errors ) = $this->fetchBlobs( [ $blobAddress ], $queryFlags );
287  // No negative caching; negative hits on text rows may be due to corrupted replica DBs
288  $error = $errors[$blobAddress] ?? null;
289  return $result[$blobAddress];
290  },
291  [ 'pcGroup' => self::TEXT_CACHE_GROUP, 'pcTTL' => IExpiringStore::TTL_PROC_LONG ]
292  );
293 
294  if ( $error ) {
295  throw new BlobAccessException( $error );
296  }
297 
298  Assert::postcondition( is_string( $blob ), 'Blob must not be null' );
299  return $blob;
300  }
301 
313  public function getBlobBatch( $blobAddresses, $queryFlags = 0 ) {
314  // FIXME: All caching has temporarily been removed in I94c6f9ba7b9caeeb due to T235188.
315  // Caching behavior should be restored by reverting I94c6f9ba7b9caeeb as soon as
316  // the root cause of T235188 has been resolved.
317 
318  list( $blobsByAddress, $errors ) = $this->fetchBlobs( $blobAddresses, $queryFlags );
319 
320  $blobsByAddress = array_map( function ( $blob ) {
321  return $blob === false ? null : $blob;
322  }, $blobsByAddress );
323 
324  $result = StatusValue::newGood( $blobsByAddress );
325  if ( $errors ) {
326  foreach ( $errors as $error ) {
327  $result->warning( 'internalerror', $error );
328  }
329  }
330  return $result;
331  }
332 
343  private function fetchBlobs( $blobAddresses, $queryFlags ) {
344  $textIdToBlobAddress = [];
345  $result = [];
346  $errors = [];
347  foreach ( $blobAddresses as $blobAddress ) {
348  try {
349  list( $schema, $id ) = self::splitBlobAddress( $blobAddress );
350  } catch ( InvalidArgumentException $ex ) {
351  throw new BlobAccessException(
352  $ex->getMessage() . '. Use findBadBlobs.php to remedy.',
353  0,
354  $ex
355  );
356  }
357 
358  // TODO: MCR: also support 'ex' schema with ExternalStore URLs, plus flags encoded in the URL!
359  if ( $schema === 'bad' ) {
360  // Database row was marked as "known bad", no need to trigger an error.
361  wfDebug(
362  __METHOD__
363  . ": loading known-bad content ($blobAddress), returning empty string"
364  );
365  $result[$blobAddress] = '';
366  continue;
367  } elseif ( $schema === 'tt' ) {
368  $textId = intval( $id );
369 
370  if ( $textId < 1 || $id !== (string)$textId ) {
371  $errors[$blobAddress] = "Bad blob address: $blobAddress."
372  . ' Use findBadBlobs.php to remedy.';
373  $result[$blobAddress] = false;
374  }
375 
376  $textIdToBlobAddress[$textId] = $blobAddress;
377  } else {
378  $errors[$blobAddress] = "Unknown blob address schema: $schema."
379  . ' Use findBadBlobs.php to remedy.';
380  $result[$blobAddress] = false;
381  continue;
382  }
383  }
384 
385  $textIds = array_keys( $textIdToBlobAddress );
386  if ( !$textIds ) {
387  return [ $result, $errors ];
388  }
389  // Callers doing updates will pass in READ_LATEST as usual. Since the text/blob tables
390  // do not normally get rows changed around, set READ_LATEST_IMMUTABLE in those cases.
391  $queryFlags |= DBAccessObjectUtils::hasFlags( $queryFlags, self::READ_LATEST )
392  ? self::READ_LATEST_IMMUTABLE
393  : 0;
394  list( $index, $options, $fallbackIndex, $fallbackOptions ) =
395  DBAccessObjectUtils::getDBOptions( $queryFlags );
396  // Text data is immutable; check replica DBs first.
397  $dbConnection = $this->getDBConnection( $index );
398  $rows = $dbConnection->select(
399  'text',
400  [ 'old_id', 'old_text', 'old_flags' ],
401  [ 'old_id' => $textIds ],
402  __METHOD__,
403  $options
404  );
405 
406  // Fallback to DB_MASTER in some cases if not all the rows were found, using the appropriate
407  // options, such as FOR UPDATE to avoid missing rows due to REPEATABLE-READ.
408  if ( $dbConnection->numRows( $rows ) !== count( $textIds ) && $fallbackIndex !== null ) {
409  $fetchedTextIds = [];
410  foreach ( $rows as $row ) {
411  $fetchedTextIds[] = $row->old_id;
412  }
413  $missingTextIds = array_diff( $textIds, $fetchedTextIds );
414  $dbConnection = $this->getDBConnection( $fallbackIndex );
415  $rowsFromFallback = $dbConnection->select(
416  'text',
417  [ 'old_id', 'old_text', 'old_flags' ],
418  [ 'old_id' => $missingTextIds ],
419  __METHOD__,
420  $fallbackOptions
421  );
422  $appendIterator = new AppendIterator();
423  $appendIterator->append( $rows );
424  $appendIterator->append( $rowsFromFallback );
425  $rows = $appendIterator;
426  }
427 
428  foreach ( $rows as $row ) {
429  $blobAddress = $textIdToBlobAddress[$row->old_id];
430  $blob = $this->expandBlob( $row->old_text, $row->old_flags, $blobAddress );
431  if ( $blob === false ) {
432  $errors[$blobAddress] = "Bad data in text row {$row->old_id}."
433  . ' Use findBadBlobs.php to remedy.';
434  }
435  $result[$blobAddress] = $blob;
436  }
437 
438  // If we're still missing some of the rows, set errors for missing blobs.
439  if ( count( $result ) !== count( $blobAddresses ) ) {
440  foreach ( $blobAddresses as $blobAddress ) {
441  if ( !isset( $result[$blobAddress ] ) ) {
442  $errors[$blobAddress] = "Unable to fetch blob at $blobAddress."
443  . ' Use findBadBlobs.php to remedy.';
444  $result[$blobAddress] = false;
445  }
446  }
447  }
448  return [ $result, $errors ];
449  }
450 
461  private function getCacheKey( $blobAddress ) {
462  return $this->cache->makeGlobalKey(
463  'SqlBlobStore-blob',
464  $this->dbLoadBalancer->resolveDomainID( $this->dbDomain ),
465  $blobAddress
466  );
467  }
468 
488  public function expandBlob( $raw, $flags, $cacheKey = null ) {
489  if ( is_string( $flags ) ) {
490  $flags = explode( ',', $flags );
491  }
492 
493  // Use external methods for external objects, text in table is URL-only then
494  if ( in_array( 'external', $flags ) ) {
495  $url = $raw;
496  $parts = explode( '://', $url, 2 );
497  if ( count( $parts ) == 1 || $parts[1] == '' ) {
498  return false;
499  }
500 
501  if ( $cacheKey ) {
502  // The cached value should be decompressed, so handle that and return here.
503  return $this->cache->getWithSetCallback(
504  $this->getCacheKey( $cacheKey ),
505  $this->getCacheTTL(),
506  function () use ( $url, $flags ) {
507  // Ignore $setOpts; blobs are immutable and negatives are not cached
508  $blob = $this->extStoreAccess
509  ->fetchFromURL( $url, [ 'domain' => $this->dbDomain ] );
510 
511  return $blob === false ? false : $this->decompressData( $blob, $flags );
512  },
513  [ 'pcGroup' => self::TEXT_CACHE_GROUP, 'pcTTL' => WANObjectCache::TTL_PROC_LONG ]
514  );
515  } else {
516  $blob = $this->extStoreAccess->fetchFromURL( $url, [ 'domain' => $this->dbDomain ] );
517  return $blob === false ? false : $this->decompressData( $blob, $flags );
518  }
519  } else {
520  return $this->decompressData( $raw, $flags );
521  }
522  }
523 
540  public function compressData( &$blob ) {
541  $blobFlags = [];
542 
543  // Revisions not marked as UTF-8 will have legacy decoding applied by decompressData().
544  // XXX: if $this->legacyEncoding is not set, we could skip this. That would however be
545  // risky, since $this->legacyEncoding being set in the future would lead to data corruption.
546  $blobFlags[] = 'utf-8';
547 
548  if ( $this->compressBlobs ) {
549  if ( function_exists( 'gzdeflate' ) ) {
550  $deflated = gzdeflate( $blob );
551 
552  if ( $deflated === false ) {
553  wfLogWarning( __METHOD__ . ': gzdeflate() failed' );
554  } else {
555  $blob = $deflated;
556  $blobFlags[] = 'gzip';
557  }
558  } else {
559  wfDebug( __METHOD__ . " -- no zlib support, not compressing" );
560  }
561  }
562  return implode( ',', $blobFlags );
563  }
564 
580  public function decompressData( $blob, array $blobFlags ) {
581  // Revision::decompressRevisionText accepted false here, so defend against that
582  Assert::parameterType( 'string', $blob, '$blob' );
583 
584  if ( in_array( 'error', $blobFlags ) ) {
585  // Error row, return false
586  return false;
587  }
588 
589  if ( in_array( 'gzip', $blobFlags ) ) {
590  # Deal with optional compression of archived pages.
591  # This can be done periodically via maintenance/compressOld.php, and
592  # as pages are saved if $wgCompressRevisions is set.
593  $blob = gzinflate( $blob );
594 
595  if ( $blob === false ) {
596  wfWarn( __METHOD__ . ': gzinflate() failed' );
597  return false;
598  }
599  }
600 
601  if ( in_array( 'object', $blobFlags ) ) {
602  # Generic compressed storage
603  $obj = unserialize( $blob );
604  if ( !is_object( $obj ) ) {
605  // Invalid object
606  return false;
607  }
608  $blob = $obj->getText();
609  }
610 
611  // Needed to support old revisions left over from the 1.4 / 1.5 migration.
612  if ( $blob !== false && $this->legacyEncoding
613  && !in_array( 'utf-8', $blobFlags ) && !in_array( 'utf8', $blobFlags )
614  ) {
615  # Old revisions kept around in a legacy encoding?
616  # Upconvert on demand.
617  # ("utf8" checked for compatibility with some broken
618  # conversion scripts 2008-12-30)
619  # Even with //IGNORE iconv can whine about illegal characters in
620  # *input* string. We just ignore those too.
621  # REF: https://bugs.php.net/bug.php?id=37166
622  # REF: https://phabricator.wikimedia.org/T18885
623  AtEase::suppressWarnings();
624  $blob = iconv( $this->legacyEncoding, 'UTF-8//IGNORE', $blob );
625  AtEase::restoreWarnings();
626  }
627 
628  return $blob;
629  }
630 
638  private function getCacheTTL() {
639  if ( $this->cache->getQoS( WANObjectCache::ATTR_EMULATION )
640  <= WANObjectCache::QOS_EMULATION_SQL
641  ) {
642  // Do not cache RDBMs blobs in...the RDBMs store
643  $ttl = WANObjectCache::TTL_UNCACHEABLE;
644  } else {
645  $ttl = $this->cacheExpiry ?: WANObjectCache::TTL_UNCACHEABLE;
646  }
647 
648  return $ttl;
649  }
650 
671  public function getTextIdFromAddress( $address ) {
672  list( $schema, $id, ) = self::splitBlobAddress( $address );
673 
674  if ( $schema !== 'tt' ) {
675  return null;
676  }
677 
678  $textId = intval( $id );
679 
680  if ( !$textId || $id !== (string)$textId ) {
681  throw new InvalidArgumentException( "Malformed text_id: $id" );
682  }
683 
684  return $textId;
685  }
686 
700  public static function makeAddressFromTextId( $id ) {
701  return 'tt:' . $id;
702  }
703 
714  public static function splitBlobAddress( $address ) {
715  if ( !preg_match( '/^([-+.\w]+):([^\s?]+)(\?([^\s]*))?$/', $address, $m ) ) {
716  throw new InvalidArgumentException( "Bad blob address: $address" );
717  }
718 
719  $schema = strtolower( $m[1] );
720  $id = $m[2];
721  $parameters = isset( $m[4] ) ? wfCgiToArray( $m[4] ) : [];
722 
723  return [ $schema, $id, $parameters ];
724  }
725 
726  public function isReadOnly() {
727  if ( $this->useExternalStore && $this->extStoreAccess->isReadOnly() ) {
728  return true;
729  }
730 
731  return ( $this->getDBLoadBalancer()->getReadOnlyReason() !== false );
732  }
733 }
MediaWiki\Storage\SqlBlobStore\getBlob
getBlob( $blobAddress, $queryFlags=0)
Retrieve a blob, given an address.
Definition: SqlBlobStore.php:277
MediaWiki\Storage\SqlBlobStore\getDBLoadBalancer
getDBLoadBalancer()
Definition: SqlBlobStore.php:199
MediaWiki\Storage\BlobAccessException
Exception representing a failure to access a data blob.
Definition: BlobAccessException.php:33
StatusValue
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition: StatusValue.php:43
MediaWiki\Storage\SqlBlobStore\getCacheKey
getCacheKey( $blobAddress)
Get a cache key for a given Blob address.
Definition: SqlBlobStore.php:461
MediaWiki\Storage\SqlBlobStore\TEXT_CACHE_GROUP
const TEXT_CACHE_GROUP
Definition: SqlBlobStore.php:54
MediaWiki\Storage\SqlBlobStore\$useExternalStore
bool $useExternalStore
Definition: SqlBlobStore.php:94
MediaWiki\Storage\SqlBlobStore\getDBConnection
getDBConnection( $index)
Definition: SqlBlobStore.php:208
MediaWiki\Storage\SqlBlobStore
Service for storing and loading Content objects.
Definition: SqlBlobStore.php:51
MediaWiki\Storage\SqlBlobStore\__construct
__construct(ILoadBalancer $dbLoadBalancer, ExternalStoreAccess $extStoreAccess, WANObjectCache $cache, $dbDomain=false)
Definition: SqlBlobStore.php:107
MediaWiki\Storage\SqlBlobStore\$compressBlobs
bool $compressBlobs
Definition: SqlBlobStore.php:84
MediaWiki\Storage\SqlBlobStore\$dbDomain
string bool $dbDomain
DB domain ID of a wiki or false for the local one.
Definition: SqlBlobStore.php:74
MediaWiki\Storage\SqlBlobStore\getTextIdFromAddress
getTextIdFromAddress( $address)
Returns an ID corresponding to the old_id field in the text table, corresponding to the given $addres...
Definition: SqlBlobStore.php:671
MediaWiki\Storage\SqlBlobStore\splitBlobAddress
static splitBlobAddress( $address)
Splits a blob address into three parts: the schema, the ID, and parameters/flags.
Definition: SqlBlobStore.php:714
MediaWiki\Storage\SqlBlobStore\expandBlob
expandBlob( $raw, $flags, $cacheKey=null)
Expand a raw data blob according to the flags given.
Definition: SqlBlobStore.php:488
MediaWiki\Storage\SqlBlobStore\$dbLoadBalancer
ILoadBalancer $dbLoadBalancer
Definition: SqlBlobStore.php:59
wfLogWarning
wfLogWarning( $msg, $callerOffset=1, $level=E_USER_WARNING)
Send a warning as a PHP error and the debug log.
Definition: GlobalFunctions.php:1087
DBAccessObjectUtils\getDBOptions
static getDBOptions( $bitfield)
Get an appropriate DB index, options, and fallback DB index for a query.
Definition: DBAccessObjectUtils.php:52
IDBAccessObject
Interface for database access objects.
Definition: IDBAccessObject.php:57
MediaWiki\Storage\SqlBlobStore\getBlobBatch
getBlobBatch( $blobAddresses, $queryFlags=0)
A batched version of BlobStore::getBlob.
Definition: SqlBlobStore.php:313
ExternalStoreAccess
Key/value blob storage for a collection of storage medium types (e.g.
Definition: ExternalStoreAccess.php:22
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
MediaWiki\Storage\SqlBlobStore\getCompressBlobs
getCompressBlobs()
Definition: SqlBlobStore.php:138
MediaWiki\Storage\SqlBlobStore\getLegacyEncoding
getLegacyEncoding()
Definition: SqlBlobStore.php:153
IExpiringStore
Generic interface providing TTL constants for lightweight expiring object stores.
Definition: IExpiringStore.php:13
MWException
MediaWiki exception.
Definition: MWException.php:29
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that $function is deprecated.
Definition: GlobalFunctions.php:1027
MediaWiki\Storage\SqlBlobStore\getLegacyEncodingConversionLang
getLegacyEncodingConversionLang()
Definition: SqlBlobStore.php:161
MediaWiki\Storage\SqlBlobStore\getCacheTTL
getCacheTTL()
Get the text cache TTL.
Definition: SqlBlobStore.php:638
MediaWiki\Storage\SqlBlobStore\$extStoreAccess
ExternalStoreAccess $extStoreAccess
Definition: SqlBlobStore.php:64
MediaWiki\Storage\SqlBlobStore\isReadOnly
isReadOnly()
Check if the blob metadata or backing blob data store is read-only.
Definition: SqlBlobStore.php:726
$blob
$blob
Definition: testCompression.php:70
MediaWiki\Storage\SqlBlobStore\makeAddressFromTextId
static makeAddressFromTextId( $id)
Returns an address referring to content stored in the text table row with the given ID.
Definition: SqlBlobStore.php:700
wfCgiToArray
wfCgiToArray( $query)
This is the logical opposite of wfArrayToCgi(): it accepts a query string as its argument and returns...
Definition: GlobalFunctions.php:391
DB_MASTER
const DB_MASTER
Definition: defines.php:26
wfDebug
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Definition: GlobalFunctions.php:910
DBAccessObjectUtils
Helper class for DAO classes.
Definition: DBAccessObjectUtils.php:29
DBAccessObjectUtils\hasFlags
static hasFlags( $bitfield, $flags)
Definition: DBAccessObjectUtils.php:35
MediaWiki\Storage\SqlBlobStore\storeBlob
storeBlob( $data, $hints=[])
Stores an arbitrary blob of data and returns an address that can be used with getBlob() to retrieve t...
Definition: SqlBlobStore.php:223
StatusValue\newGood
static newGood( $value=null)
Factory function for good results.
Definition: StatusValue.php:82
WANObjectCache
Multi-datacenter aware caching interface.
Definition: WANObjectCache.php:125
MediaWiki\Storage\SqlBlobStore\fetchBlobs
fetchBlobs( $blobAddresses, $queryFlags)
MCR migration note: this corresponds to Revision::fetchText.
Definition: SqlBlobStore.php:343
MediaWiki\Storage\SqlBlobStore\getUseExternalStore
getUseExternalStore()
Definition: SqlBlobStore.php:183
MediaWiki\Storage
Definition: BlobAccessException.php:23
MediaWiki\Storage\SqlBlobStore\getCacheExpiry
getCacheExpiry()
Definition: SqlBlobStore.php:122
MediaWiki\Storage\SqlBlobStore\setLegacyEncoding
setLegacyEncoding( $legacyEncoding)
Set the legacy encoding to assume for blobs that do not have the utf-8 flag set.
Definition: SqlBlobStore.php:174
MediaWiki\Storage\SqlBlobStore\$cacheExpiry
int $cacheExpiry
Definition: SqlBlobStore.php:79
MediaWiki\Storage\BlobStore
Service for loading and storing data blobs.
Definition: BlobStore.php:35
unserialize
unserialize( $serialized)
Definition: ApiMessageTrait.php:146
MediaWiki\Storage\SqlBlobStore\decompressData
decompressData( $blob, array $blobFlags)
Re-converts revision text according to its flags.
Definition: SqlBlobStore.php:580
MediaWiki\Storage\SqlBlobStore\setUseExternalStore
setUseExternalStore( $useExternalStore)
Definition: SqlBlobStore.php:190
MediaWiki\Storage\SqlBlobStore\setCompressBlobs
setCompressBlobs( $compressBlobs)
Definition: SqlBlobStore.php:145
wfWarn
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
Definition: GlobalFunctions.php:1074
MediaWiki\Storage\SqlBlobStore\$cache
WANObjectCache $cache
Definition: SqlBlobStore.php:69
MediaWiki\Storage\SqlBlobStore\compressData
compressData(&$blob)
If $wgCompressRevisions is enabled, we will compress data.
Definition: SqlBlobStore.php:540
MediaWiki\Storage\SqlBlobStore\$legacyEncoding
bool string $legacyEncoding
Definition: SqlBlobStore.php:89
MediaWiki\Storage\SqlBlobStore\setCacheExpiry
setCacheExpiry( $cacheExpiry)
Definition: SqlBlobStore.php:129
Wikimedia\Rdbms\ILoadBalancer
Database cluster connection, tracking, load balancing, and transaction manager interface.
Definition: ILoadBalancer.php:81