Exemplo n.º 1
0
 private function fixBlankRecords()
 {
     global $wgLanguageCode;
     $sql = "SELECT ti_page_id FROM titus_intl where ti_page_title = '' AND ti_language_code='" . $wgLanguageCode . "'";
     $ids = array();
     $res = $this->performMaintenanceQuery($sql);
     foreach ($res as $row) {
         $ids[] = $row->ti_page_id;
     }
     if (!empty($ids)) {
         $pageChunks = array_chunk($ids, 1000);
         foreach ($pageChunks as $chunk) {
             $titus = $this->titus;
             $dailyEditStats = TitusConfig::getDailyEditStats();
             $titus->calcStatsForPageIds($dailyEditStats, $chunk);
         }
     }
 }
Exemplo n.º 2
0
<?php

require_once 'commandLine.inc';
require_once "{$IP}/extensions/wikihow/titus/Titus.class.php";
$statsToCalc = TitusConfig::getDailyEditStats();
$titus = new TitusDB(true);
/*
$titus->calcStatsForAllPages($statsToCalc);*/
$ids = array(163806);
$titus->calcStatsForPageIds($statsToCalc, $ids);
/*$dailyEditStats = TitusConfig::getDailyEditStats();
$titus->calcLatestEdits($dailyEditStats);*/
Exemplo n.º 3
0
<?php

require_once 'commandLine.inc';
require_once "{$IP}/extensions/wikihow/titus/Titus.class.php";
$titus = new TitusDB(true);
$stats = TitusConfig::getDailyEditStats();
$stats['RobotPolicy'] = 0;
$stats['Social'] = 0;
$dbr = new Database(TITUS_DB_HOST, WH_DATABASE_MAINTENANCE_USER, WH_DATABASE_MAINTENANCE_PASSWORD, TitusDB::TITUS_DB_NAME);
$sql = "select ti_page_id from titus_intl where ti_language_code='{$wgLanguageCode}' AND ti_num_steps=0";
$res = $dbr->query($sql);
$ids = array();
foreach ($res as $row) {
    $ids[] = $row->ti_page_id;
}
$batch = array();
foreach ($ids as $id) {
    $batch[] = $id;
    if (sizeof($batch) == 999) {
        $titus->calcStatsForPageIds($stats, $batch);
        $batch = array();
    }
}
$titus->calcStatsForPageIds($stats, $batch);