diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-06-22 11:28:20 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-06-22 11:28:20 +0200 |
commit | 9db190c7e736ec8d063187d4241b59feaf7dc2d1 (patch) | |
tree | 46d1a0dee7febef5c2d57a9f7b972be16a163b3d /includes/ExternalStoreDB.php | |
parent | 78677c7bbdcc9739f6c10c75935898a20e1acd9e (diff) |
update to MediaWiki 1.17.0
Diffstat (limited to 'includes/ExternalStoreDB.php')
-rw-r--r-- | includes/ExternalStoreDB.php | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/includes/ExternalStoreDB.php b/includes/ExternalStoreDB.php index 769c64da..877277a2 100644 --- a/includes/ExternalStoreDB.php +++ b/includes/ExternalStoreDB.php @@ -1,26 +1,6 @@ <?php /** - * External database storage will use one (or more) separate connection pools - * from what the main wiki uses. If we load many revisions, such as when doing - * bulk backups or maintenance, we want to keep them around over the lifetime - * of the script. - * - * Associative array of LoadBalancer objects, indexed by cluster name. - */ -global $wgExternalLoadBalancers; -$wgExternalLoadBalancers = array(); - -/** - * One-step cache variable to hold base blobs; operations that - * pull multiple revisions may often pull multiple times from - * the same blob. By keeping the last-used one open, we avoid - * redundant unserialization and decompression overhead. - */ -global $wgExternalBlobCache; -$wgExternalBlobCache = array(); - -/** * DB accessable external objects * @ingroup ExternalStorage */ @@ -113,11 +93,18 @@ class ExternalStoreDB { * @private */ function &fetchBlob( $cluster, $id, $itemID ) { - global $wgExternalBlobCache; + /** + * One-step cache variable to hold base blobs; operations that + * pull multiple revisions may often pull multiple times from + * the same blob. By keeping the last-used one open, we avoid + * redundant unserialization and decompression overhead. + */ + static $externalBlobCache = array(); + $cacheID = ( $itemID === false ) ? "$cluster/$id" : "$cluster/$id/"; - if( isset( $wgExternalBlobCache[$cacheID] ) ) { + if( isset( $externalBlobCache[$cacheID] ) ) { wfDebug( "ExternalStoreDB::fetchBlob cache hit on $cacheID\n" ); - return $wgExternalBlobCache[$cacheID]; + return $externalBlobCache[$cacheID]; } wfDebug( "ExternalStoreDB::fetchBlob cache miss on $cacheID\n" ); @@ -138,7 +125,7 @@ class ExternalStoreDB { $ret = unserialize( $ret ); } - $wgExternalBlobCache = array( $cacheID => &$ret ); + $externalBlobCache = array( $cacheID => &$ret ); return $ret; } |