r41323 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41322‎ | r41323 | r41324 >
Date:22:51, 27 September 2008
Author:aaron
Status:old
Tags:
Comment:
objectcache cleanup (bug 7474)
Modified paths:
  • /trunk/phase3/includes/ObjectCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ObjectCache.php
@@ -48,23 +48,21 @@
4949 }
5050
5151 if ( $type == CACHE_MEMCACHED ) {
52 - if ( !array_key_exists( CACHE_MEMCACHED, $wgCaches ) ){
 52+ if ( !array_key_exists( CACHE_MEMCACHED, $wgCaches ) ) {
5353 require_once( 'memcached-client.php' );
54 -
55 - if (!class_exists("MemcachedClientforWiki")) {
 54+ if ( !class_exists("MemcachedClientforWiki") ) {
5655 class MemCachedClientforWiki extends memcached {
5756 function _debugprint( $text ) {
5857 wfDebug( "memcached: $text" );
5958 }
6059 }
6160 }
62 -
63 - $wgCaches[CACHE_DB] = new MemCachedClientforWiki(
 61+ $wgCaches[CACHE_MEMCACHED] = new MemCachedClientforWiki(
6462 array('persistant' => $wgMemCachedPersistent, 'compress_threshold' => 1500 ) );
65 - $cache =& $wgCaches[CACHE_DB];
66 - $cache->set_servers( $wgMemCachedServers );
67 - $cache->set_debug( $wgMemCachedDebug );
 63+ $wgCaches[CACHE_MEMCACHED]->set_servers( $wgMemCachedServers );
 64+ $wgCaches[CACHE_MEMCACHED]->set_debug( $wgMemCachedDebug );
6865 }
 66+ $cache =& $wgCaches[CACHE_MEMCACHED];
6967 } elseif ( $type == CACHE_ACCEL ) {
7068 if ( !array_key_exists( CACHE_ACCEL, $wgCaches ) ) {
7169 if ( function_exists( 'eaccelerator_get' ) ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r16928Bug 7474, CACHE_DB/CACHE_MEMCACHED confusiontstarling08:12, 11 October 2006