- $key = wfMemcKey( 'ipb', 'autoblock', 'whitelist' );
- $lines = $wgMemc->get( $key );
- if ( !$lines ) {
- $lines = explode( "\n", wfMessage( 'autoblock_whitelist' )->inContentLanguage()->plain() );
- $wgMemc->set( $key, $lines, 3600 * 24 );
- }
+ $cache = ObjectCache::getMainWANInstance();
+ $lines = $cache->getWithSetCallback(
+ wfMemcKey( 'ipb', 'autoblock', 'whitelist' ),
+ $cache::TTL_DAY,
+ function () {
+ return explode( "\n",
+ wfMessage( 'autoblock_whitelist' )->inContentLanguage()->plain() );
+ }
+ );