Lines Matching refs:diff

3  * A PHP diff engine for phpwiki. (Taken from phpwiki-1.3.3)
125 function diff($from_lines, $to_lines) {
517 * Class representing a 'diff' between two sequences of strings.
525 * Computes diff between sequences of strings.
533 $this->edits = $eng->diff($from_lines, $to_lines);
542 * $diff = new Diff($lines1, $lines2);
543 * $rev = $diff->reverse();
546 * original diff.
558 * Check for empty diff.
661 * Computes diff between sequences of strings.
676 * when computing the diff.
709 * This class formats the diff in classic diff format.
731 * Format a diff.
733 * @param Diff $diff A Diff object.
736 function format($diff) {
748 foreach ($diff->edits as $edit) {
898 'diff-addedline' => 'background-color: #ddffdd;',
899 'diff-deletedline' => 'background-color: #ffdddd;',
900 'diff-context' => 'background-color: #f5f5f5;',
901 'diff-mark' => 'color: #ff0000;',
924 * Additions by Axel Boldt follow, partly taken from diff.php, phpwiki-1.3.3
954 $this->_line .= '<strong '.HTMLDiff::css('diff-mark').'>'.$this->_escape($this->_group).'</strong>';
956 $this->_line .= '<span '.HTMLDiff::css('diff-addedline').'>'.$this->_escape($this->_group).'</span>';
958 $this->_line .= '<span '.HTMLDiff::css('diff-deletedline').'><del>'.$this->_escape($this->_group).'</del></span>';
1083 * "Unified" diff formatter.
1085 * This class formats the diff in classic "unified diff" format.
1117 * Wikipedia Table style diff formatter.
1129 * @param Diff $diff
1132 function format($diff) {
1135 $val = parent::format($diff);
1150 $r = '<tr><td '.HTMLDiff::css('diff-blockheader').' colspan="'.$this->colspan.'">'.$l1.":</td>\n".
1151 '<td '.HTMLDiff::css('diff-blockheader').' colspan="'.$this->colspan.'">'.$l2.":</td>\n".
1170 return '<td '.HTMLDiff::css('diff-lineheader').'>+</td>'.
1171 '<td '.HTMLDiff::css('diff-addedline').'>' . $line.'</td>';
1178 return '<td '.HTMLDiff::css('diff-lineheader').'>-</td>'.
1179 '<td '.HTMLDiff::css('diff-deletedline').'>' . $line.'</td>';
1187 return '<td '.HTMLDiff::css('diff-lineheader').'>&#160;</td>'.
1188 '<td '.HTMLDiff::css('diff-context').'>'.$this->_escape($line).'</td>';
1214 $diff = new WordLevelDiff($orig, $closing); // this escapes the diff data
1215 $del = $diff->orig();
1216 $add = $diff->closing();
1231 * Inline style diff formatter.
1243 * @param Diff $diff
1246 function format($diff) {
1249 $val = parent::format($diff);
1266 $r = '<tr><td colspan="'.$this->colspan.'" '.HTMLDiff::css('diff-blockheader').'>@@ '.$lang['line']." -$xbeg +$ybeg @@";
1267 $r .= ' <span '.HTMLDiff::css('diff-deletedline').'><del>'.$lang['deleted'].'</del></span>';
1268 $r .= ' <span '.HTMLDiff::css('diff-addedline').'>'.$lang['created'].'</span>';
1285 print('<tr><td '.HTMLDiff::css('diff-lineheader').'>&#160;</td><td '.HTMLDiff::css('diff-addedline').'>'. $this->_escape($line) . "</td></tr>\n");
1291 print('<tr><td '.HTMLDiff::css('diff-lineheader').'>&#160;</td><td '.HTMLDiff::css('diff-deletedline').'><del>' . $this->_escape($line) . "</del></td></tr>\n");
1297 print('<tr><td '.HTMLDiff::css('diff-lineheader').'>&#160;</td><td '.HTMLDiff::css('diff-context').'>'. $this->_escape($line) ."</td></tr>\n");
1302 $diff = new InlineWordLevelDiff($orig, $closing); // this escapes the diff data
1303 $add = $diff->inline();
1306 print('<tr><td '.HTMLDiff::css('diff-lineheader').'>&#160;</td><td>'.$line."</td></tr>\n");
1329 * Computes diff between 3 sequences of strings.
1338 $this->_edits = $this->_diff3($engine->diff($orig, $final1),
1339 $engine->diff($orig, $final2));
1388 * diff3 diff block, if any. */