Menu

[2eb2a2]: / utils / diffutils.inc.php  Maximize  Restore  History

Download this file

35 lines (28 with data), 774 Bytes

 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
<?php
/*
Help functions used in get_diffs_changelog.php to
display differences between script revisions.
(c) 2007-2013 HB9TVM and the deltasql team
*/
function starts_with($Haystack, $Needle){
return strpos($Haystack, $Needle) === 0;
}
function print_block($block) {
if (starts_with($block, "+")) {
echo "<tr bgcolor=\"#33FF00\"><td><code>$block</code></td></tr>\n";
} else
if (starts_with($block, "-")) {
echo "<tr bgcolor=\"#FDD017\"><td><code>$block</code></td></tr>\n";
} else {
echo "<tr><td><code>$block</code></td></tr>\n";
}
}
function color_diff($difftext) {
$lines = explode( "\n", $difftext);
echo "<table border='0'>\n";
for ( $i = 0; $i < sizeof( $lines ); $i++ ) {
print_block($lines[$i]);
}
echo "</table>\n";
}
?>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.