scraper monitoring page
[disclosr.git] / admin / resolveConflicts.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
 
include_once('../include/common.inc.php');
include_header();
// Include the diff class
echo '<STYLE TYPE="text/css">
<!--
  @import url(../lib/php-diff/example/styles.css);
-->
</STYLE>
    ';
require_once dirname(__FILE__) . '/../lib/php-diff/lib/Diff.php';
// Generate a side by side diff
require_once dirname(__FILE__) . '/../lib/php-diff/lib/Diff/Renderer/Html/SideBySide.php';
$renderer = new Diff_Renderer_Html_SideBySide;
 
 
 
$db = $server->get_db('disclosr-agencies');
$docs = Array();
try {
    $rows = $db->get_view("app", "getConflicts")->rows;
    //print_r($rows);
    foreach ($rows as $row) {
        echo '<h2>' . $row->id . '</h2>';
        echo "Comparing " . $row->value[0] . " and " . $row->value[1];
        $docA = explode(",", json_encode($db->get($row->id . "?rev=" . $row->value[0])));
        $docB = explode(",", json_encode($db->get($row->id . "?rev=" . $row->value[1])));
        // Options for generating the diff
        $options = array(
                //'ignoreWhitespace' => true,
                //'ignoreCase' => true,
        );
 
        // Initialize the diff class
        $diff = new Diff($docA, $docB, $options);
        echo $diff->Render($renderer);
    }
} catch (SetteeRestClientException $e) {
    setteErrorHandler($e);
}
include_footer();
?>