X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FObjectCache.php;h=db22c0747cb061715bca4659c64ceab73770bfb5;hb=f3710b35e5a7d013ad7117f7405cc6f40942699e;hp=fe7417d2c132ea08d5fde597f7c3fcec44d13c39;hpb=73bcdd7a9090b7fa3b5e869d9fd08149533bd6ec;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ObjectCache.php b/includes/ObjectCache.php index fe7417d2c1..db22c0747c 100644 --- a/includes/ObjectCache.php +++ b/includes/ObjectCache.php @@ -1,7 +1,9 @@ $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' ) ) { - require_once( 'BagOStuff.php' ); $wgCaches[CACHE_ACCEL] = new eAccelBagOStuff; } elseif ( function_exists( 'apc_fetch') ) { - require_once( 'BagOStuff.php' ); $wgCaches[CACHE_ACCEL] = new APCBagOStuff; - } elseif ( function_exists( 'mmcache_get' ) ) { - require_once( 'BagOStuff.php' ); - $wgCaches[CACHE_ACCEL] = new TurckBagOStuff; + } elseif( function_exists( 'xcache_get' ) ) { + $wgCaches[CACHE_ACCEL] = new XCacheBagOStuff(); + } elseif( function_exists( 'wincache_ucache_get' ) ) { + $wgCaches[CACHE_ACCEL] = new WinCacheBagOStuff(); } else { $wgCaches[CACHE_ACCEL] = false; } @@ -84,12 +77,16 @@ 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'); + $wgCaches[CACHE_DB] = new SqlBagOStuff('objectcache'); } $cache =& $wgCaches[CACHE_DB]; } @@ -104,22 +101,23 @@ function &wfGetCache( $inputType ) { return $cache; } +/** Get the main cache object */ function &wfGetMainCache() { global $wgMainCacheType; $ret =& wfGetCache( $wgMainCacheType ); return $ret; } +/** Get the cache object used by the message cache */ function &wfGetMessageCacheStorage() { global $wgMessageCacheType; $ret =& wfGetCache( $wgMessageCacheType ); return $ret; } +/** Get the cache object used by the parser cache */ function &wfGetParserCacheStorage() { global $wgParserCacheType; $ret =& wfGetCache( $wgParserCacheType ); return $ret; } - -?>