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