X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2FStorage%2FSqlBlobStore.php;h=82410cc5b9dff6160a67b8f493147de8271038fb;hb=75cffa0b998b300b4d79ab3d1e7f61857d32b1aa;hp=d7216c5c7209c91d21e63a435fb39606b023ab1e;hpb=3de7bf779d3c3efe33c9b440c4b6dbee4433d40e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Storage/SqlBlobStore.php b/includes/Storage/SqlBlobStore.php index d7216c5c72..82410cc5b9 100644 --- a/includes/Storage/SqlBlobStore.php +++ b/includes/Storage/SqlBlobStore.php @@ -35,7 +35,6 @@ use Language; use MWException; use WANObjectCache; use Wikimedia\Assert\Assert; -use Wikimedia\Rdbms\Database; use Wikimedia\Rdbms\IDatabase; use Wikimedia\Rdbms\LoadBalancer; @@ -275,9 +274,7 @@ class SqlBlobStore implements IDBAccessObject, BlobStore { $this->getCacheKey( $blobAddress ), $this->getCacheTTL(), function ( $unused, &$ttl, &$setOpts ) use ( $blobAddress, $queryFlags ) { - list( $index ) = DBAccessObjectUtils::getDBOptions( $queryFlags ); - $setOpts += Database::getCacheSetOptions( $this->getDBConnection( $index ) ); - + // Ignore $setOpts; blobs are immutable and negatives are not cached return $this->fetchBlob( $blobAddress, $queryFlags ); }, [ 'pcGroup' => self::TEXT_CACHE_GROUP, 'pcTTL' => IExpiringStore::TTL_PROC_LONG ] @@ -417,7 +414,7 @@ class SqlBlobStore implements IDBAccessObject, BlobStore { $this->getCacheKey( $cacheKey ), $this->getCacheTTL(), function () use ( $url, $flags ) { - // No negative caching per BlobStore::getBlob() + // Ignore $setOpts; blobs are immutable and negatives are not cached $blob = ExternalStore::fetchFromURL( $url, [ 'wiki' => $this->wikiId ] ); return $blob === false ? false : $this->decompressData( $blob, $flags ); @@ -609,12 +606,14 @@ class SqlBlobStore implements IDBAccessObject, BlobStore { /** * Splits a blob address into three parts: the schema, the ID, and parameters/flags. * + * @since 1.33 + * * @param string $address * * @throws InvalidArgumentException * @return array [ $schema, $id, $parameters ], with $parameters being an assoc array. */ - private static function splitBlobAddress( $address ) { + public static function splitBlobAddress( $address ) { if ( !preg_match( '/^(\w+):(\w+)(\?(.*))?$/', $address, $m ) ) { throw new InvalidArgumentException( "Bad blob address: $address" ); }