Beispiel #1
0
$defer = !@ignore_user_abort() || $conf['broken_iua'];
if (!$defer) {
    sendGIF();
    // send gif
}
$ID = cleanID($_REQUEST['id']);
// Catch any possible output (e.g. errors)
if (!isset($_REQUEST['debug'])) {
    ob_start();
}
// run one of the jobs
$tmp = array();
// No event data
$evt = new Doku_Event('INDEXER_TASKS_RUN', $tmp);
if ($evt->advise_before()) {
    runIndexer() or metaUpdate() or runSitemapper() or runTrimRecentChanges() or runTrimRecentChanges(true) or $evt->advise_after();
}
if ($defer) {
    sendGIF();
}
if (!isset($_REQUEST['debug'])) {
    ob_end_clean();
}
exit;
// --------------------------------------------------------------------
/**
 * Trims the recent changes cache (or imports the old changelog) as needed.
 *
 * @param media_changes If the media changelog shall be trimmed instead of
 * the page changelog
 *
Beispiel #2
0
    sendGIF();
    // send gif
}
$ID = cleanID($INPUT->str('id'));
// Catch any possible output (e.g. errors)
if (!$output) {
    ob_start();
} else {
    header('Content-Type: text/plain');
}
// run one of the jobs
$tmp = array();
// No event data
$evt = new Doku_Event('INDEXER_TASKS_RUN', $tmp);
if ($evt->advise_before()) {
    runIndexer() or runSitemapper() or sendDigest() or runTrimRecentChanges() or runTrimRecentChanges(true) or $evt->advise_after();
}
if (!$output) {
    ob_end_clean();
    if ($defer) {
        sendGIF();
    }
}
exit;
// --------------------------------------------------------------------
/**
 * Trims the recent changes cache (or imports the old changelog) as needed.
 *
 * @param media_changes If the media changelog shall be trimmed instead of
 * the page changelog
 *
    }
    echo "Indexing more then one count pages\n";
    $res = $db->select(array('imagelinks'), array('il_from,count(*) as cnt'), array("il_from in (select il_from from image inner join imagelinks where  img_media_type != 'VIDEO' and il_to = img_name and il_from not in (select page_id from page_wikia_props))"), __METHOD__, array("GROUP BY" => "il_from", "HAVING" => "cnt > 1"));
    $total_num = $res->numRows();
    $out = array();
    $count = 0;
    $total_count = 0;
    $startTime = Time();
    Wikia::log(__METHOD__, 'imageServingIndexer', 'starting for:' . $wgCityId . " total number:" . $total_num);
    while ($row = $db->fetchRow($res)) {
        $total_count++;
        $count++;
        $out[] = $row['il_from'];
        if ($count == package_size) {
            runIndexer($out, $total_count, $total_num);
            $out = array();
        }
    }
    if (!empty($out)) {
        runIndexer($out, $total_count, $total_num);
    }
    Wikia::log(__METHOD__, 'imageServingIndexer', 'end for:' . $wgCityId . " total time:" . (Time() - $startTime));
}
function runIndexer($out, $total_count, $total_num)
{
    global $IP, $wgCityId, $wgWikiaLocalSettingsPath;
    Wikia::log(__METHOD__, 'imageServingIndexer', 'next pack for:' . $wgCityId . " " . $total_count . "/" . $total_num);
    $count = 0;
    $cmd = array("SERVER_ID={$wgCityId}", "php", "{$IP}/maintenance/wikia/imageServingIndexer.php", "--do", "--list " . implode(",", $out), "--conf {$wgWikiaLocalSettingsPath}");
    system(implode(" ", $cmd), $status);
}