Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 13
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
PurgeCachedStats
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 execute
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3use MediaWiki\Extension\ExtensionDistributor\Stats\ExtDistGraphiteStats;
4use MediaWiki\Logger\LoggerFactory;
5use MediaWiki\Maintenance\Maintenance;
6
7if ( getenv( 'MW_INSTALL_PATH' ) ) {
8    $IP = getenv( 'MW_INSTALL_PATH' );
9} else {
10    $IP = __DIR__ . '/../../..';
11}
12require_once "$IP/maintenance/Maintenance.php";
13
14/**
15 * @author Addshore
16 */
17class PurgeCachedStats extends Maintenance {
18
19    public function __construct() {
20        parent::__construct();
21        $this->addDescription( "Purge cached ExtensionDistributor stats" );
22        $this->requireExtension( 'ExtensionDistributor' );
23    }
24
25    public function execute() {
26        $graphiteStats = new ExtDistGraphiteStats();
27        $graphiteStats->setLogger( LoggerFactory::getInstance( 'ExtensionDistributor' ) );
28        $graphiteStats->clearCache();
29        $this->output( "Done.\n" );
30    }
31
32}
33
34$maintClass = PurgeCachedStats::class;
35require_once RUN_MAINTENANCE_IF_MAIN;