Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
UpdateFlaggedRevsStats
0.00% covered (danger)
0.00%
0 / 9
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 / 6
0.00% covered (danger)
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 */
9if ( getenv( 'MW_INSTALL_PATH' ) ) {
10    $IP = getenv( 'MW_INSTALL_PATH' );
11} else {
12    $IP = __DIR__ . '/../../..';
13}
14
15require_once "$IP/maintenance/Maintenance.php";
16
17class UpdateFlaggedRevsStats extends Maintenance {
18
19    public function __construct() {
20        parent::__construct();
21        $this->addDescription( "Update FlaggedRevs statistics table" );
22        $this->requireExtension( 'FlaggedRevs' );
23    }
24
25    /**
26     * @inheritDoc
27     */
28    public function execute() {
29        $this->output( sprintf( '%-30s ', 'ValidationStatistics' ) );
30
31        $time1 = microtime( true );
32        FlaggedRevsStats::updateCache();
33        $time2 = microtime( true );
34
35        $elapsed = ( $time2 - $time1 );
36        $this->output( sprintf( "completed in %.2fs\n", $elapsed ) );
37    }
38}
39
40$maintClass = UpdateFlaggedRevsStats::class;
41require_once RUN_MAINTENANCE_IF_MAIN;