59 $this->edits = $eng->diff( $from_lines, $to_lines );
84 foreach ( $this->edits as $edit ) {
85 $rev->edits[] = $edit->reverse();
97 foreach ( $this->edits as $edit ) {
98 if ( $edit->type !=
'copy' ) {
115 foreach ( $this->edits as $edit ) {
116 if ( $edit->type ==
'copy' ) {
117 $lcs += count( $edit->orig );
135 foreach ( $this->edits as $edit ) {
137 array_splice(
$lines, count(
$lines ), 0, $edit->orig );
155 foreach ( $this->edits as $edit ) {
156 if ( $edit->closing ) {
157 array_splice(
$lines, count(
$lines ), 0, $edit->closing );
This diff implementation is mainly lifted from the LCS algorithm of the Eclipse project which in turn...
setBailoutComplexity( $value)
Sets the complexity (in comparison operations) that can't be exceeded.
The base class for all other DiffOp classes.
Class representing a 'diff' between two sequences of strings.
int $bailoutComplexity
If this diff complexity is exceeded, a ComplexityException is thrown 0 means no limit.
reverse()
Compute reversed Diff.
orig()
Get the original set of lines.
isEmpty()
Check for empty diff.
lcs()
Compute the length of the Longest Common Subsequence (LCS).
closing()
Get the closing set of lines.
__construct( $from_lines, $to_lines)
Computes diff between sequences of strings.
if(!file_exists( $CREDITS)) $lines