88d08ba858a7dfe807c0cc1b5bbc688f476e8bb2
3 * This script is used to clear the interwiki links for ALL languages in
9 require_once( "Maintenance.php" );
11 class ClearInterwikiCache
extends Maintenance
{
13 public function __construct() {
14 parent
::__construct();
15 $this->mDescription
= "Clear all interwiki links for all languages from the cache";
18 public function execute() {
19 global $wgLocalDatabases;
20 $dbr = wfGetDB( DB_SLAVE
);
21 $res = $dbr->select( 'interwiki', array( 'iw_prefix' ), false );
23 while ( $row = $dbr->fetchObject( $res ) ) {
24 $prefixes[] = $row->iw_prefix
;
27 foreach ( $wgLocalDatabases as $db ) {
28 $this->output( "$db..." );
29 foreach ( $prefixes as $prefix ) {
30 $wgMemc->delete("$db:interwiki:$prefix");
32 $this->output( "done\n" );
37 $maintClass = "ClearInterwikiCache";
38 require_once( DO_MAINTENANCE
);