Index: trunk/extensions/CodeReview/CodeRepository.php |
— | — | @@ -177,7 +177,7 @@ |
178 | 178 | * 'cached' to *only* fetch if cached |
179 | 179 | */ |
180 | 180 | public function getDiff( $rev, $useCache = '' ) { |
181 | | - global $wgMemc, $wgDefaultExternalStore; |
| 181 | + global $wgMemc; |
182 | 182 | wfProfileIn( __METHOD__ ); |
183 | 183 | |
184 | 184 | $rev1 = $rev - 1; |
— | — | @@ -198,7 +198,7 @@ |
199 | 199 | } |
200 | 200 | |
201 | 201 | # Try the database... |
202 | | - if( !$data ) { |
| 202 | + if( !$data && $useCache != 'skipcache' ) { |
203 | 203 | $dbr = wfGetDB( DB_SLAVE ); |
204 | 204 | $row = $dbr->selectRow( 'code_rev', |
205 | 205 | array( 'cr_diff', 'cr_flags' ), |
— | — | @@ -208,16 +208,6 @@ |
209 | 209 | if( $row ) { |
210 | 210 | $flags = explode( ',', $row->cr_flags ); |
211 | 211 | $data = $row->cr_diff; |
212 | | - # Use external methods for external objects, text in table is URL-only then |
213 | | - if( in_array( 'external', $flags ) ) { |
214 | | - $url = $data; |
215 | | - @list(/* $proto */,$path) = explode('://',$url,2); |
216 | | - if( $path == "" ) { |
217 | | - $data = false; // something is wrong... |
218 | | - } else { |
219 | | - $data = ExternalStore::fetchFromURL($url); |
220 | | - } |
221 | | - } |
222 | 212 | // If the text was fetched without an error, convert it |
223 | 213 | if( $data !== false && in_array( 'gzip', $flags ) ) { |
224 | 214 | # Deal with optional compression of archived pages. |
— | — | @@ -236,18 +226,6 @@ |
237 | 227 | $wgMemc->set( $key, $data, 3600*24*3 ); |
238 | 228 | // Permanent DB storage |
239 | 229 | $flags = Revision::compressRevisionText( $data ); |
240 | | - if( ($storage = $wgDefaultExternalStore) ) { |
241 | | - if( is_array($storage) ) { |
242 | | - # Distribute storage across multiple clusters |
243 | | - $store = $storage[mt_rand(0, count( $storage ) - 1)]; |
244 | | - } else { |
245 | | - $store = $storage; |
246 | | - } |
247 | | - # Store and get the URL |
248 | | - $data = ExternalStore::insert( $store, $data ); |
249 | | - if( $flags ) $flags .= ','; |
250 | | - $flags .= 'external'; |
251 | | - } |
252 | 230 | $dbw = wfGetDB( DB_MASTER ); |
253 | 231 | $dbw->update( 'code_rev', |
254 | 232 | array( 'cr_diff' => $data, 'cr_flags' => $flags ), |