r71877 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71876‎ | r71877 | r71878 >
Date:11:03, 29 August 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Let import translations work without main memory cache defined
Modified paths:
  • /trunk/extensions/Translate/SpecialImportTranslations.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/SpecialImportTranslations.php
@@ -273,29 +273,17 @@
274274 }
275275
276276 protected function setCachedData( $data ) {
277 - global $wgMemc;
278 -
279277 $key = wfMemcKey( 'translate', 'webimport', $this->user->getId() );
280 -
281 - /**
282 - * Cache 15 minutes.
283 - */
284 - $wgMemc->set( $key, $data, 60 * 15 );
 278+ wfGetCache( CACHE_DB )->set( $key, $data, 60 * 30 );
285279 }
286280
287281 protected function getCachedData() {
288 - global $wgMemc;
289 -
290282 $key = wfMemcKey( 'translate', 'webimport', $this->user->getId() );
291 -
292 - return $wgMemc->get( $key );
 283+ return wfGetCache( CACHE_DB )->get( $key );
293284 }
294285
295286 protected function deleteCachedData() {
296 - global $wgMemc;
297 -
298287 $key = wfMemcKey( 'translate', 'webimport', $this->user->getId() );
299 -
300 - return $wgMemc->delete( $key );
 288+ return wfGetCache( CACHE_DB )->delete( $key );
301289 }
302290 }

Status & tagging log