r45248 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45247‎ | r45248 | r45249 >
Date:19:36, 31 December 2008
Author:aaron
Status:ok
Tags:
Comment:
Remove ES use and fix diff purging
Modified paths:
  • /trunk/extensions/CodeReview/CodeRepository.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeRepository.php
@@ -177,7 +177,7 @@
178178 * 'cached' to *only* fetch if cached
179179 */
180180 public function getDiff( $rev, $useCache = '' ) {
181 - global $wgMemc, $wgDefaultExternalStore;
 181+ global $wgMemc;
182182 wfProfileIn( __METHOD__ );
183183
184184 $rev1 = $rev - 1;
@@ -198,7 +198,7 @@
199199 }
200200
201201 # Try the database...
202 - if( !$data ) {
 202+ if( !$data && $useCache != 'skipcache' ) {
203203 $dbr = wfGetDB( DB_SLAVE );
204204 $row = $dbr->selectRow( 'code_rev',
205205 array( 'cr_diff', 'cr_flags' ),
@@ -208,16 +208,6 @@
209209 if( $row ) {
210210 $flags = explode( ',', $row->cr_flags );
211211 $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 - }
222212 // If the text was fetched without an error, convert it
223213 if( $data !== false && in_array( 'gzip', $flags ) ) {
224214 # Deal with optional compression of archived pages.
@@ -236,18 +226,6 @@
237227 $wgMemc->set( $key, $data, 3600*24*3 );
238228 // Permanent DB storage
239229 $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 - }
252230 $dbw = wfGetDB( DB_MASTER );
253231 $dbw->update( 'code_rev',
254232 array( 'cr_diff' => $data, 'cr_flags' => $flags ),

Status & tagging log