Exemplo n.º 1
0
 public function execute()
 {
     $this->output(sprintf('%-30s ', 'ValidationStatistics'));
     $time1 = microtime(true);
     FlaggedRevsStats::updateCache();
     $time2 = microtime(true);
     $ellapsed = $time2 - $time1;
     $this->output(sprintf("completed in %.2fs\n", $ellapsed));
 }
 public static function parserPagesUsingPendingChanges(&$parser, $ns = '')
 {
     $nsList = FlaggedRevs::getReviewNamespaces();
     if (!$nsList) {
         return 0;
     }
     if ($ns !== '') {
         $ns = intval($ns);
         if (!in_array($ns, $nsList)) {
             return 0;
         }
     }
     static $pcCounts = null;
     if (!$pcCounts) {
         $stats = FlaggedRevsStats::getStats();
         $reviewedPerNS = $stats['reviewedPages-NS'];
         $totalCount = 0;
         foreach ($reviewedPerNS as $ns => $reviewed) {
             $nsList["ns-{$ns}"] = $reviewed;
             $totalCount += $reviewed;
         }
         $nsList['all'] = $totalCount;
     }
     if ($ns === '') {
         return $nsList['all'];
     } else {
         return $nsList["ns-{$ns}"];
     }
 }
 protected function getStats()
 {
     if ($this->latestData === null) {
         $this->latestData = FlaggedRevsStats::getStats();
     }
     return $this->latestData;
 }