<?php
/**
- * @addtogroup Cache
+ * @file
+ * @ingroup Cache
*/
/**
* It acts as a memcached server with no RAM, that is, all objects are
* cleared the moment they are set. All set operations succeed and all
* get operations return null.
- * @addtogroup Cache
+ * @ingroup Cache
*/
class FakeMemCachedClient {
function add ($key, $val, $exp = 0) { return true; }
}
if ( $type == CACHE_MEMCACHED ) {
- if ( !array_key_exists( CACHE_MEMCACHED, $wgCaches ) ){
+ if ( !array_key_exists( CACHE_MEMCACHED, $wgCaches ) ) {
require_once( 'memcached-client.php' );
-
- if (!class_exists("MemcachedClientforWiki")) {
+ if ( !class_exists("MemcachedClientforWiki") ) {
class MemCachedClientforWiki extends memcached {
function _debugprint( $text ) {
- wfDebug( "memcached: $text\n" );
+ wfDebug( "memcached: $text" );
}
}
}
-
- $wgCaches[CACHE_DB] = new MemCachedClientforWiki(
+ $wgCaches[CACHE_MEMCACHED] = new MemCachedClientforWiki(
array('persistant' => $wgMemCachedPersistent, 'compress_threshold' => 1500 ) );
- $cache =& $wgCaches[CACHE_DB];
- $cache->set_servers( $wgMemCachedServers );
- $cache->set_debug( $wgMemCachedDebug );
+ $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' ) ) {
$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' ) ) {
$wgCaches[CACHE_ACCEL] = new TurckBagOStuff;
} else {
}
$cache =& $wgCaches[CACHE_DBA];
}
-
+
if ( $type == CACHE_DB || ( $inputType == CACHE_ANYTHING && $cache === false ) ) {
if ( !array_key_exists( CACHE_DB, $wgCaches ) ) {
$wgCaches[CACHE_DB] = new MediaWikiBagOStuff('objectcache');
$ret =& wfGetCache( $wgParserCacheType );
return $ret;
}
-
-?>