Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 15 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
UpdateFlaggedRevsStats | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
execute | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * This file is run hourly by the following cron job: |
4 | * https://gerrit.wikimedia.org/g/operations/puppet/+/production/modules/profile/manifests/mediawiki/maintenance/update_flaggedrev_stats.pp |
5 | * Do not rename this file without also fixing the file path in Puppet. |
6 | * |
7 | * @ingroup Maintenance |
8 | */ |
9 | |
10 | use MediaWiki\Maintenance\Maintenance; |
11 | |
12 | if ( getenv( 'MW_INSTALL_PATH' ) ) { |
13 | $IP = getenv( 'MW_INSTALL_PATH' ); |
14 | } else { |
15 | $IP = __DIR__ . '/../../..'; |
16 | } |
17 | |
18 | require_once "$IP/maintenance/Maintenance.php"; |
19 | |
20 | class UpdateFlaggedRevsStats extends Maintenance { |
21 | |
22 | public function __construct() { |
23 | parent::__construct(); |
24 | $this->addDescription( "Update FlaggedRevs statistics table" ); |
25 | $this->requireExtension( 'FlaggedRevs' ); |
26 | } |
27 | |
28 | /** |
29 | * @inheritDoc |
30 | */ |
31 | public function execute() { |
32 | $this->output( sprintf( '%-30s ', 'ValidationStatistics' ) ); |
33 | |
34 | $time1 = microtime( true ); |
35 | FlaggedRevsStats::updateCache(); |
36 | $time2 = microtime( true ); |
37 | |
38 | $elapsed = ( $time2 - $time1 ); |
39 | $this->output( sprintf( "completed in %.2fs\n", $elapsed ) ); |
40 | } |
41 | } |
42 | |
43 | $maintClass = UpdateFlaggedRevsStats::class; |
44 | require_once RUN_MAINTENANCE_IF_MAIN; |