[ Index ] |
PHP Cross Reference of Unnamed Project |
[Source view] [Print] [Project Stats]
(no description)
Copyright: | (c) 2006 phpBB Group |
License: | http://opensource.org/licenses/gpl-license.php GNU Public License |
Version: | $Id$ |
File Size: | 554 lines (14 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
diff_engine:: (5 methods):
diff()
_diag()
_lcs_pos()
_compareseq()
_shift_boundaries()
Class: diff_engine - X-Ref
Code from pear.php.net, Text_Diff-1.1.0 packagediff(&$from_lines, &$to_lines, $preserve_cr = true) X-Ref |
If set to true we trim all lines before we compare them. This ensures that sole space/tab changes do not trigger diffs. |
_diag($xoff, $xlim, $yoff, $ylim, $nchunks) X-Ref |
Divides the Largest Common Subsequence (LCS) of the sequences (XOFF, XLIM) and (YOFF, YLIM) into NCHUNKS approximately equally sized segments. Returns (LCS, PTS). LCS is the length of the LCS. PTS is an array of NCHUNKS+1 (X, Y) indexes giving the diving points between sub sequences. The first sub-sequence is contained in (X0, X1), (Y0, Y1), the second in (X1, X2), (Y1, Y2) and so on. Note that (X0, Y0) == (XOFF, YOFF) and (X[NCHUNKS], Y[NCHUNKS]) == (XLIM, YLIM). This function assumes that the first lines of the specified portions of the two files do not match, and likewise that the last lines do not match. The caller must trim matching lines from the beginning and end of the portions it is going to specify. |
_lcs_pos($ypos) X-Ref |
No description |
_compareseq($xoff, $xlim, $yoff, $ylim) X-Ref |
Finds LCS of two sequences. The results are recorded in the vectors $this->{x,y}changed[], by storing a 1 in the element for each line that is an insertion or deletion (ie. is not in the LCS). The subsequence of file 0 is (XOFF, XLIM) and likewise for file 1. Note that XLIM, YLIM are exclusive bounds. All line numbers are origin-0 and discarded lines are not counted. |
_shift_boundaries($lines, &$changed, $other_changed) X-Ref |
Adjusts inserts/deletes of identical lines to join changes as much as possible. We do something when a run of changed lines include a line at one end and has an excluded, identical line at the other. We are free to choose which identical line is included. 'compareseq' usually chooses the one at the beginning, but usually it is cleaner to consider the following identical line to be the "change". This is extracted verbatim from analyze.c (GNU diffutils-2.7). |
Generated: Wed Oct 2 15:03:47 2013 | Cross-referenced by PHPXref 0.7.1 |