MediaWiki
REL1_19
|
00001 <?php 00024 require_once( dirname( __FILE__ ) . '/Maintenance.php' ); 00025 00026 class clear_stats extends Maintenance { 00027 00028 public function __construct() { 00029 parent::__construct(); 00030 $this->mDescription = "Remove all statistics tracking from the cache"; 00031 } 00032 00033 public function execute() { 00034 global $wgLocalDatabases, $wgMemc; 00035 foreach ( $wgLocalDatabases as $db ) { 00036 $wgMemc->delete( "$db:stats:request_with_session" ); 00037 $wgMemc->delete( "$db:stats:request_without_session" ); 00038 $wgMemc->delete( "$db:stats:pcache_hit" ); 00039 $wgMemc->delete( "$db:stats:pcache_miss_expired" ); 00040 $wgMemc->delete( "$db:stats:pcache_miss_absent" ); 00041 $wgMemc->delete( "$db:stats:pcache_miss_stub" ); 00042 $wgMemc->delete( "$db:stats:image_cache_hit" ); 00043 $wgMemc->delete( "$db:stats:image_cache_miss" ); 00044 $wgMemc->delete( "$db:stats:image_cache_update" ); 00045 $wgMemc->delete( "$db:stats:diff_cache_hit" ); 00046 $wgMemc->delete( "$db:stats:diff_cache_miss" ); 00047 $wgMemc->delete( "$db:stats:diff_uncacheable" ); 00048 $wgMemc->delete( "$db:stats:job-insert" ); 00049 $wgMemc->delete( "$db:stats:job-pop" ); 00050 } 00051 } 00052 } 00053 00054 $maintClass = "clear_stats"; 00055 require_once( RUN_MAINTENANCE_IF_MAIN );