|
dolibarr 25.0.0-alpha
|
Ajax fragment to show the diff of a modified file against its original version. More...
Go to the source code of this file.
Functions | |
| if(!in_array( $algo, array( 'md5', 'sha256'), true)) | filecheckLineDiff ($a, $b) |
| Compute a line based diff between two arrays of lines, restricted to the changed region (common prefix and suffix are trimmed first to keep it cheap and memory safe). | |
| filecheckMiddleDiff ($a, $b) | |
| Diff of the changed region. | |
| filecheckFindAnchor ($a, $b) | |
| Find a line that appears exactly once in both arrays (a unique common "anchor"), choosing the candidate closest to the middle of $a to balance the recursion. | |
| filecheckLcs ($a, $b) | |
| Diff of two small arrays of lines using a classic LCS dynamic programming matrix. | |
| filecheckCollapseContext ($diff, $context=3) | |
| Collapse long runs of unchanged context lines, keeping a few lines around each change. | |
| llxFooterFragment () | |
| Close the fragment output and stop the script. | |
Ajax fragment to show the diff of a modified file against its original version.
Definition in file filecheck_diff.php.
| filecheckCollapseContext | ( | $diff, | |
| $context = 3 ) |
Collapse long runs of unchanged context lines, keeping a few lines around each change.
| array<array{0:string,1:string}> | $diff Full diff as returned by filecheckLineDiff() | |
| int | $context | Number of context lines to keep around changes |
Definition at line 261 of file filecheck_diff.php.
References $context.
| filecheckFindAnchor | ( | $a, | |
| $b ) |
Find a line that appears exactly once in both arrays (a unique common "anchor"), choosing the candidate closest to the middle of $a to balance the recursion.
| string[] | $a | Lines |
| string[] | $b | Lines |
Definition at line 169 of file filecheck_diff.php.
Referenced by filecheckMiddleDiff().
| filecheckLcs | ( | $a, | |
| $b ) |
Diff of two small arrays of lines using a classic LCS dynamic programming matrix.
| string[] | $a | Lines of the original file |
| string[] | $b | Lines of the local file |
Definition at line 205 of file filecheck_diff.php.
Referenced by filecheckMiddleDiff().
| if(!in_array($algo, array('md5', 'sha256'), true)) filecheckLineDiff | ( | $a, | |
| $b ) |
Compute a line based diff between two arrays of lines, restricted to the changed region (common prefix and suffix are trimmed first to keep it cheap and memory safe).
| string[] | $a | Lines of the original file |
| string[] | $b | Lines of the local file |
Definition at line 71 of file filecheck_diff.php.
References filecheckMiddleDiff().
| filecheckMiddleDiff | ( | $a, | |
| $b ) |
Diff of the changed region.
For large regions, the region is recursively split on unique common lines (anchors, patience-diff style) so the expensive LCS only runs on small segments. This keeps small changes detected instead of one big block.
| string[] | $a | Changed lines of the original file |
| string[] | $b | Changed lines of the local file |
Definition at line 117 of file filecheck_diff.php.
References filecheckFindAnchor(), filecheckLcs(), and filecheckMiddleDiff().
Referenced by filecheckLineDiff(), and filecheckMiddleDiff().
| llxFooterFragment | ( | ) |
Close the fragment output and stop the script.
Definition at line 391 of file filecheck_diff.php.
References $db.