Exemplo n.º 1
0
function ewiki_sync_no_conflict($id, $OLD_api, $NEWER_api)
{
    #-- fetch
    $OLD = $OLD_api("::GET", array($id));
    // last
    $NEW = $NEWER_api("::GET", array($id, $R["version"]));
    #-- 700% identical!
    if (md5(serialize($OLD)) == serialize(md5($NEW))) {
        return true;
    } else {
        return ewiki_sync_half_identical($OLD, $NEW);
    }
}
Exemplo n.º 2
0
    }
    #-- download
    if (in_array($action, array("download", "sync", "exact"))) {
        echo "<br>\n<h3>download</h3>\n";
        ewiki_sync_start("download", $ls_remote, $ls_local, "ewiki_sync_remote", "ewiki_sync_local");
    }
    #-- do an in-deepth analyzation of remaining files
    if ($action == "exact") {
        echo "<br>\n<h3>sync - exact comparison</h3>\n";
        foreach ($ls_local as $id => $ver) {
            if ($ls_remote[$id] == $ver) {
                echo htmlentities($id);
                flush();
                $L = ewiki_sync_local("::GET", array($id));
                $R = ewiki_sync_remote("::GET", array($id));
                if (!ewiki_sync_half_identical($L, $R)) {
                    echo " - conflict";
                } else {
                    echo " - ok";
                }
                echo "<br>\n";
            }
        }
    }
}
?>
<br>
<br>
</body>
</html>