Diff
class Diff
Class representing a 'diff' between two sequences of strings.
Properties
static | $html_cleaner_class | ||
$edits |
Methods
Constructor.
Compute reversed Diff.
Check for empty diff.
Compute the length of the Longest Common Subsequence (LCS).
Get the original set of lines.
Get the final set of lines.
Check a Diff for validity.
Attempt to clean invalid HTML, which messes up diffs.
No description
No description
Details
at line 541
__construct($from_lines, $to_lines)
Constructor.
Computes diff between sequences of strings.
at line 557
object
reverse()
Compute reversed Diff.
SYNOPSIS:
$diff = new Diff($lines1, $lines2); $rev = $diff->reverse();
at line 571
bool
isEmpty()
Check for empty diff.
at line 586
int
lcs()
Compute the length of the Longest Common Subsequence (LCS).
This is mostly for diagnostic purposed.
at line 603
array
orig()
Get the original set of lines.
This reconstructs the $from_lines parameter passed to the constructor.
at line 621
array
finaltext()
Get the final set of lines.
This reconstructs the $to_lines parameter passed to the constructor.
at line 636
_check($from_lines, $to_lines)
Check a Diff for validity.
This is here only for debugging purposes.
at line 673
static
cleanHTML(string $content, object $cleaner = null)
Attempt to clean invalid HTML, which messes up diffs.
This cleans code if possible, using an instance of HTMLCleaner
NB: By default, only extremely simple tidying is performed, by passing through DomDocument::loadHTML and saveXML