예제 #1
0
    $diffs = new Diff($ota, $nta);
    $formatter = new TableDiffFormatter();
    $funky = $formatter->format($diffs);
    preg_match_all('/<span class="diffchange">(.*?)<\\/span>/', $funky, $matches);
    foreach ($matches[1] as $bit) {
        $hex = bin2hex($bit);
        echo "\t{$hex}\n";
    }
}
$size = 16;
$n = 0;
while (true) {
    $n++;
    echo "{$n}\n";
    $str = randomString($size, true);
    $clean = UtfNormal::cleanUp($str);
    $norm = donorm($str);
    echo strlen($clean) . ", " . strlen($norm);
    if ($clean == $norm) {
        echo " (match)\n";
    } else {
        echo " (FAIL)\n";
        echo "\traw: " . bin2hex($str) . "\n" . "\tphp: " . bin2hex($clean) . "\n" . "\ticu: " . bin2hex($norm) . "\n";
        echo "\n\tdiffs:\n";
        showDiffs($clean, $norm);
        die;
    }
    $str = '';
    $clean = '';
    $norm = '';
}
예제 #2
0
파일: wiki.php 프로젝트: ratbird/hope
    SkipLinks::addIndex(_("Alle Seiten"), 'main_content', 100);
    listPages("all", Request::option('sortby'));
} else {
    if ($view == "listnew") {
        //
        // list new pages, default sorting = newest first
        //
        SkipLinks::addIndex(_("Neue Seiten"), 'main_content', 100);
        listPages("new", Request::option('sortby'));
    } else {
        if ($view == "diff") {
            //
            // show one large diff-file containing all changes
            //
            SkipLinks::addIndex(_("Seite mit Änderungen"), 'main_content', 100);
            showDiffs($keyword, Request::option('versionssince'));
        } else {
            if ($view == "combodiff") {
                //
                // show one large diff-file containing all changes
                //
                SkipLinks::addIndex(_("Seite mit Änderungen"), 'main_content', 100);
                showComboDiff($keyword);
            } else {
                if ($view == "export") {
                    //
                    // show export dialog
                    //
                    SkipLinks::addIndex(_("Seiten exportieren"), 'wiki_export', 100);
                    exportWiki();
                } else {