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 | use MediaWiki\Maintenance\Maintenance; |
6 | |
7 | if ( getenv( 'MW_INSTALL_PATH' ) ) { |
8 | $IP = getenv( 'MW_INSTALL_PATH' ); |
9 | } else { |
10 | $IP = __DIR__ . '/../../..'; |
11 | } |
12 | require_once "$IP/maintenance/Maintenance.php"; |
13 | |
14 | /** |
15 | * @author Addshore |
16 | */ |
17 | class 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; |
35 | require_once RUN_MAINTENANCE_IF_MAIN; |