X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fexternalstore%2FExternalStoreDB.php;h=422e1fb553637cb7781193562e780d109b46ef9d;hb=53fd8295ff186fc1d01a4f45bd8bbcd5a0bfc1d2;hp=5edb4b2ef0f954937a52e092e847c81ada6800a8;hpb=312c32319d701f62d49b1509e68dd43d585f3273;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/externalstore/ExternalStoreDB.php b/includes/externalstore/ExternalStoreDB.php index 5edb4b2ef0..422e1fb553 100644 --- a/includes/externalstore/ExternalStoreDB.php +++ b/includes/externalstore/ExternalStoreDB.php @@ -128,7 +128,7 @@ class ExternalStoreDB extends ExternalStoreMedium { public function getSlave( $cluster ) { global $wgDefaultExternalStore; - $wiki = isset( $this->params['wiki'] ) ? $this->params['wiki'] : false; + $wiki = $this->params['wiki'] ?? false; $lb = $this->getLoadBalancer( $cluster ); if ( !in_array( "DB://" . $cluster, (array)$wgDefaultExternalStore ) ) { @@ -151,7 +151,7 @@ class ExternalStoreDB extends ExternalStoreMedium { * @return MaintainableDBConnRef */ public function getMaster( $cluster ) { - $wiki = isset( $this->params['wiki'] ) ? $this->params['wiki'] : false; + $wiki = $this->params['wiki'] ?? false; $lb = $this->getLoadBalancer( $cluster ); $db = $lb->getMaintenanceConnectionRef( DB_MASTER, [], $wiki ); @@ -194,6 +194,10 @@ class ExternalStoreDB extends ExternalStoreMedium { static $externalBlobCache = []; $cacheID = ( $itemID === false ) ? "$cluster/$id" : "$cluster/$id/"; + + $wiki = $this->params['wiki'] ?? false; + $cacheID = ( $wiki === false ) ? $cacheID : "$cacheID@$wiki"; + if ( isset( $externalBlobCache[$cacheID] ) ) { wfDebugLog( 'ExternalStoreDB-cache', "ExternalStoreDB::fetchBlob cache hit on $cacheID" ); @@ -301,7 +305,7 @@ class ExternalStoreDB extends ExternalStoreMedium { return [ $path[2], // cluster $path[3], // id - isset( $path[4] ) ? $path[4] : false // itemID + $path[4] ?? false // itemID ]; } }