コード例 #1
0
ファイル: functions.php プロジェクト: splitio/php-client
function hash($key, $seed)
{
    return splitHash($key, $seed);
    //return murmurhash3_int($key, $seed);
}
コード例 #2
0
function fetchKeptPages($title)
{
    global $FS, $FS1, $FS2, $FS3, $wgRootDirectory, $wgTimezoneCorrection;
    $fname = $wgRootDirectory . "/keep/" . useModFilename($title) . ".kp";
    if (!file_exists($fname)) {
        return array();
    }
    $keptlist = explode($FS1, file_get_contents($fname));
    array_shift($keptlist);
    # Drop the junk at beginning of file
    $revisions = array();
    foreach ($keptlist as $rev) {
        $section = splitHash($FS2, $rev);
        $text = splitHash($FS3, $section["data"]);
        if ($text["text"] && $text["minor"] != "" && $section["ts"] * 1 > 0) {
            array_push($revisions, array2object(array("text" => $text["text"], "summary" => $text["summary"], "minor" => $text["minor"], "ts" => $section["ts"], "username" => $section["username"], "host" => $section["host"])));
        } else {
            echo "<!-- skipped a bad old revision -->\n";
        }
    }
    return $revisions;
}