diff options
Diffstat (limited to 'maintenance/clear_interwiki_cache.php')
-rw-r--r-- | maintenance/clear_interwiki_cache.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/maintenance/clear_interwiki_cache.php b/maintenance/clear_interwiki_cache.php new file mode 100644 index 00000000..97869728 --- /dev/null +++ b/maintenance/clear_interwiki_cache.php @@ -0,0 +1,26 @@ +<?php +/** + * This script is used to clear the interwiki links for ALL languages in + * memcached. + * @package MediaWiki + * @subpackage Maintenance + */ + +/** */ +require_once('commandLine.inc'); + +$dbr =& wfGetDB( DB_SLAVE ); +$res = $dbr->select( 'interwiki', array( 'iw_prefix' ), false ); +$prefixes = array(); +while ( $row = $dbr->fetchObject( $res ) ) { + $prefixes[] = $row->iw_prefix; +} + +foreach ( $wgLocalDatabases as $db ) { + print "$db "; + foreach ( $prefixes as $prefix ) { + $wgMemc->delete("$db:interwiki:$prefix"); + } +} +print "\n"; +?> |