r101500 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101499‎ | r101500 | r101501 >
Date:16:51, 1 November 2011
Author:catrope
Status:ok
Tags:
Comment:
Revert r101492, broken, see CR. Also revert followup r101496.
Modified paths:
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/LocalisationCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LocalisationCache.php
@@ -159,13 +159,8 @@
160160 case 'db':
161161 $storeClass = 'LCStore_DB';
162162 break;
163 - case 'accel':
164163 case 'detect':
165 - if ( !( wfGetCache( CACHE_ACCEL ) instanceof FakeMemCachedClient ) ) {
166 - $storeClass = 'LCStore_Accel';
167 - } else {
168 - $storeClass = $wgCacheDirectory ? 'LCStore_CDB' : 'LCStore_DB';
169 - }
 164+ $storeClass = $wgCacheDirectory ? 'LCStore_CDB' : 'LCStore_DB';
170165 break;
171166 default:
172167 throw new MWException(
@@ -353,9 +348,7 @@
354349 }
355350
356351 $deps = $this->store->get( $code, 'deps' );
357 - $keys = $this->store->get( $code, 'list', 'messages' );
358 - // 'list:messages' sometimes expires separately of 'deps' in LCStore_Accel
359 - if ( $deps === null || $keys === null ) {
 352+ if ( $deps === null ) {
360353 wfDebug( __METHOD__."($code): cache missing, need to make one\n" );
361354 return true;
362355 }
@@ -837,56 +830,6 @@
838831 }
839832
840833 /**
841 - * LCStore implementation which uses PHP accelerator to store data.
842 - * This will work if one of XCache, eAccelerator, or APC cacher is configured.
843 - * (See ObjectCache.php)
844 - */
845 -class LCStore_Accel implements LCStore {
846 - var $currentLang;
847 - var $keys;
848 -
849 - public function __construct() {
850 - $this->cache = wfGetCache( CACHE_ACCEL );
851 - }
852 -
853 - public function get( $code, $key ) {
854 - $k = wfMemcKey( 'l10n', $code, 'k', $key );
855 - $r = $this->cache->get( $k );
856 - if ( $r === false ) return null;
857 - return $r;
858 - }
859 -
860 - public function startWrite( $code ) {
861 - $k = wfMemcKey( 'l10n', $code, 'l' );
862 - $keys = $this->cache->get( $k );
863 - if ( $keys ) {
864 - foreach ( $keys as $k ) {
865 - $this->cache->delete( $k );
866 - }
867 - }
868 - $this->currentLang = $code;
869 - $this->keys = array();
870 - }
871 -
872 - public function finishWrite() {
873 - if ( $this->currentLang ) {
874 - $k = wfMemcKey( 'l10n', $this->currentLang, 'l' );
875 - $this->cache->set( $k, array_keys( $this->keys ) );
876 - }
877 - $this->currentLang = null;
878 - $this->keys = array();
879 - }
880 -
881 - public function set( $key, $value ) {
882 - if ( $this->currentLang ) {
883 - $k = wfMemcKey( 'l10n', $this->currentLang, 'k', $key );
884 - $this->keys[$k] = true;
885 - $this->cache->set( $k, $value );
886 - }
887 - }
888 -}
889 -
890 -/**
891834 * LCStore implementation which uses the standard DB functions to store data.
892835 * This will work on any MediaWiki installation.
893836 */
@@ -1183,4 +1126,4 @@
11841127 $this->unload( $code );
11851128 }
11861129 }
1187 -}
\ No newline at end of file
 1130+}
Index: trunk/phase3/includes/AutoLoader.php
@@ -127,7 +127,6 @@
128128 'IndexPager' => 'includes/Pager.php',
129129 'Interwiki' => 'includes/interwiki/Interwiki.php',
130130 'IP' => 'includes/IP.php',
131 - 'LCStore_Accel' => 'includes/LocalisationCache.php',
132131 'LCStore_CDB' => 'includes/LocalisationCache.php',
133132 'LCStore_DB' => 'includes/LocalisationCache.php',
134133 'LCStore_Null' => 'includes/LocalisationCache.php',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r101492Apply Vitaliy Filippov's patch from Bug #29283 with some small style modsmah16:10, 1 November 2011
r101496followup 101492 — make it actually work.mah16:29, 1 November 2011

Status & tagging log