3 require_once( dirname( __FILE__
) . '/commandLine.inc' );
5 function purgeStaleMemcachedText() {
7 $db = wfGetDB( DB_MASTER
);
8 $maxTextId = $db->selectField( 'text', 'max(old_id)' );
9 $latestReplicatedTextId = $db->selectField( array( 'revision','recentchanges'), 'rev_text_id', array( 'rev_id = rc_this_oldid', "rc_timestamp < '20101225063000'" ) );
10 $latestReplicatedTextId -= 100; # A bit of paranoia
12 for ( $i = $latestReplicatedTextId; $i < $maxTextId; $i++
) {
13 $key = wfMemcKey( 'revisiontext', 'textid', $i++
);
14 $wgMemc->delete( $key );
18 purgeStaleMemcachedText();