X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FObjectCache.php;h=07525acea7520ca945509b5c2b1f12c3c18e93b1;hb=59254f1bc827cec0872a27d222a3d1f4f9beadda;hp=336e0e67fcb02edbb0b1c7c6e0bddfdfaa618b6e;hpb=8aabcc03d19bca2afa38202d3c9e09c34adb9113;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ObjectCache.php b/includes/ObjectCache.php index 336e0e67fc..07525acea7 100644 --- a/includes/ObjectCache.php +++ b/includes/ObjectCache.php @@ -1,7 +1,7 @@ false, 'compress_threshold' => 1500 ) ); - $cache =& $wgCaches[CACHE_DB]; - $cache->set_servers( $wgMemCachedServers ); - $cache->set_debug( $wgMemCachedDebug ); + $wgCaches[CACHE_MEMCACHED] = new MemCachedClientforWiki( + array('persistant' => $wgMemCachedPersistent, 'compress_threshold' => 1500 ) ); + $wgCaches[CACHE_MEMCACHED]->set_servers( $wgMemCachedServers ); + $wgCaches[CACHE_MEMCACHED]->set_debug( $wgMemCachedDebug ); } + $cache =& $wgCaches[CACHE_MEMCACHED]; } elseif ( $type == CACHE_ACCEL ) { if ( !array_key_exists( CACHE_ACCEL, $wgCaches ) ) { if ( function_exists( 'eaccelerator_get' ) ) { - require_once( 'BagOStuff.php' ); $wgCaches[CACHE_ACCEL] = new eAccelBagOStuff; + } elseif ( function_exists( 'apc_fetch') ) { + $wgCaches[CACHE_ACCEL] = new APCBagOStuff; + } elseif( function_exists( 'xcache_get' ) ) { + $wgCaches[CACHE_ACCEL] = new XCacheBagOStuff(); } elseif ( function_exists( 'mmcache_get' ) ) { - require_once( 'BagOStuff.php' ); $wgCaches[CACHE_ACCEL] = new TurckBagOStuff; } else { $wgCaches[CACHE_ACCEL] = false; @@ -81,11 +80,15 @@ function &wfGetCache( $inputType ) { if ( $wgCaches[CACHE_ACCEL] !== false ) { $cache =& $wgCaches[CACHE_ACCEL]; } + } elseif ( $type == CACHE_DBA ) { + if ( !array_key_exists( CACHE_DBA, $wgCaches ) ) { + $wgCaches[CACHE_DBA] = new DBABagOStuff; + } + $cache =& $wgCaches[CACHE_DBA]; } if ( $type == CACHE_DB || ( $inputType == CACHE_ANYTHING && $cache === false ) ) { if ( !array_key_exists( CACHE_DB, $wgCaches ) ) { - require_once( 'BagOStuff.php' ); $wgCaches[CACHE_DB] = new MediaWikiBagOStuff('objectcache'); } $cache =& $wgCaches[CACHE_DB]; @@ -118,5 +121,3 @@ function &wfGetParserCacheStorage() { $ret =& wfGetCache( $wgParserCacheType ); return $ret; } - -?>