Index: trunk/phase3/includes/ExternalStoreDB.php |
— | — | @@ -1,26 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * External database storage will use one (or more) separate connection pools |
6 | | - * from what the main wiki uses. If we load many revisions, such as when doing |
7 | | - * bulk backups or maintenance, we want to keep them around over the lifetime |
8 | | - * of the script. |
9 | | - * |
10 | | - * Associative array of LoadBalancer objects, indexed by cluster name. |
11 | | - */ |
12 | | -global $wgExternalLoadBalancers; |
13 | | -$wgExternalLoadBalancers = array(); |
14 | | - |
15 | | -/** |
16 | | - * One-step cache variable to hold base blobs; operations that |
17 | | - * pull multiple revisions may often pull multiple times from |
18 | | - * the same blob. By keeping the last-used one open, we avoid |
19 | | - * redundant unserialization and decompression overhead. |
20 | | - */ |
21 | | -global $wgExternalBlobCache; |
22 | | -$wgExternalBlobCache = array(); |
23 | | - |
24 | | -/** |
25 | 5 | * DB accessable external objects |
26 | 6 | * @ingroup ExternalStorage |
27 | 7 | */ |
— | — | @@ -113,11 +93,18 @@ |
114 | 94 | * @private |
115 | 95 | */ |
116 | 96 | function &fetchBlob( $cluster, $id, $itemID ) { |
117 | | - global $wgExternalBlobCache; |
| 97 | + /** |
| 98 | + * One-step cache variable to hold base blobs; operations that |
| 99 | + * pull multiple revisions may often pull multiple times from |
| 100 | + * the same blob. By keeping the last-used one open, we avoid |
| 101 | + * redundant unserialization and decompression overhead. |
| 102 | + */ |
| 103 | + static $externalBlobCache = array(); |
| 104 | + |
118 | 105 | $cacheID = ( $itemID === false ) ? "$cluster/$id" : "$cluster/$id/"; |
119 | | - if( isset( $wgExternalBlobCache[$cacheID] ) ) { |
| 106 | + if( isset( $externalBlobCache[$cacheID] ) ) { |
120 | 107 | wfDebug( "ExternalStoreDB::fetchBlob cache hit on $cacheID\n" ); |
121 | | - return $wgExternalBlobCache[$cacheID]; |
| 108 | + return $externalBlobCache[$cacheID]; |
122 | 109 | } |
123 | 110 | |
124 | 111 | wfDebug( "ExternalStoreDB::fetchBlob cache miss on $cacheID\n" ); |
— | — | @@ -138,7 +125,7 @@ |
139 | 126 | $ret = unserialize( $ret ); |
140 | 127 | } |
141 | 128 | |
142 | | - $wgExternalBlobCache = array( $cacheID => &$ret ); |
| 129 | + $externalBlobCache = array( $cacheID => &$ret ); |
143 | 130 | return $ret; |
144 | 131 | } |
145 | 132 | |