*
* The format is an associative array where the key is a cache identifier, and
* the value is an associative array of parameters. The "cacheId" parameter is
- * a cache identifier from $wgObjectCaches. The "channels" parameter is a map of
- * actions ('purge') to PubSub channels defined in $wgEventRelayerConfig.
- * The "loggroup" parameter controls where log events are sent.
+ * a cache identifier from $wgObjectCaches. The "loggroup" parameter controls
+ * where log events are sent.
*
* @since 1.26
*/
$wgWANObjectCaches = [
CACHE_NONE => [
'class' => WANObjectCache::class,
- 'cacheId' => CACHE_NONE,
- 'channels' => []
+ 'cacheId' => CACHE_NONE
]
/* Example of a simple single data-center cache:
'memcached-php' => [
'class' => WANObjectCache::class,
- 'cacheId' => 'memcached-php',
- 'channels' => [ 'purge' => 'wancache-main-memcached-purge' ]
+ 'cacheId' => 'memcached-php'
]
*/
];
parent::setUp();
$this->cache = new WANObjectCache( [
- 'cache' => new HashBagOStuff(),
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] )
+ 'cache' => new HashBagOStuff()
] );
$wanCache = TestingAccessWrapper::newFromObject( $this->cache );
};
$cache = new NearExpiringWANObjectCache( [
- 'cache' => new HashBagOStuff(),
- 'pool' => 'empty',
+ 'cache' => new HashBagOStuff()
] );
$wasSet = 0;
};
$cache = new NearExpiringWANObjectCache( [
'cache' => new HashBagOStuff(),
- 'pool' => 'empty',
'asyncHandler' => $asyncHandler
] );
$this->assertEquals( $value, $v, "New value stored" );
$cache = new PopularityRefreshingWANObjectCache( [
- 'cache' => new HashBagOStuff(),
- 'pool' => 'empty'
+ 'cache' => new HashBagOStuff()
] );
$mockWallClock = $priorTime;
WANObjectCache::VALUE_KEY_PREFIX . 'k1' => 'val-id1',
WANObjectCache::VALUE_KEY_PREFIX . 'k2' => 'val-id2'
] );
- $wanCache = new WANObjectCache( [ 'cache' => $localBag, 'pool' => 'testcache-hash' ] );
+ $wanCache = new WANObjectCache( [ 'cache' => $localBag ] );
// Warm the process cache
$keyedIds = new ArrayIterator( [ 'k1' => 'id1', 'k2' => 'id2' ] );
->willReturn( false );
$wanCache = new WANObjectCache( [
- 'cache' => $backend,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] )
+ 'cache' => $backend
] );
$isStale = null;
$localBag->expects( $this->never() )->method( 'delete' );
$wanCache = new WANObjectCache( [
'cache' => $localBag,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] ),
'mcrouterAware' => true,
'region' => 'pmtpa',
'cluster' => 'mw-wan'
->setMethods( [ 'set' ] )->getMock();
$wanCache = new WANObjectCache( [
'cache' => $localBag,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] ),
'mcrouterAware' => true,
'region' => 'pmtpa',
'cluster' => 'mw-wan'
->setMethods( [ 'set' ] )->getMock();
$wanCache = new WANObjectCache( [
'cache' => $localBag,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] ),
'mcrouterAware' => true,
'region' => 'pmtpa',
'cluster' => 'mw-wan'
->setMethods( [ 'delete' ] )->getMock();
$wanCache = new WANObjectCache( [
'cache' => $localBag,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] ),
'mcrouterAware' => true,
'region' => 'pmtpa',
'cluster' => 'mw-wan'
public function testEpoch() {
$bag = new HashBagOStuff();
- $cache = new WANObjectCache( [ 'cache' => $bag, 'pool' => 'testcache-hash' ] );
+ $cache = new WANObjectCache( [ 'cache' => $bag ] );
$key = $cache->makeGlobalKey( 'The whole of the Law' );
$now = microtime( true );
$cache = new WANObjectCache( [
'cache' => $bag,
- 'pool' => 'testcache-hash',
'epoch' => $now - 3600
] );
$cache->setMockTime( $now );
$now += 30;
$cache = new WANObjectCache( [
'cache' => $bag,
- 'pool' => 'testcache-hash',
'epoch' => $now + 3600
] );
$cache->setMockTime( $now );
->willReturn( 'special' );
$wanCache = new WANObjectCache( [
- 'cache' => $backend,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] )
+ 'cache' => $backend
] );
$this->assertSame( 'special', $wanCache->makeKey( 'a', 'b' ) );
->willReturn( 'special' );
$wanCache = new WANObjectCache( [
- 'cache' => $backend,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] )
+ 'cache' => $backend
] );
$this->assertSame( 'special', $wanCache->makeGlobalKey( 'a', 'b' ) );
*/
public function testStatsKeyClass( $key, $class ) {
$wanCache = TestingAccessWrapper::newFromObject( new WANObjectCache( [
- 'cache' => new HashBagOStuff,
- 'pool' => 'testcache-hash',
- 'relayer' => new EventRelayerNull( [] )
+ 'cache' => new HashBagOStuff
] ) );
$this->assertEquals( $class, $wanCache->determineKeyClass( $key ) );