76 if ( array_key_exists( $i, $this->closing ) ) {
77 return $this->closing[$i];
88 return $this->orig ? count( $this->orig ) : 0;
95 return $this->closing ? count( $this->closing ) : 0;
121 return new DiffOpCopy( $this->closing, $this->orig );
137 $this->closing =
false;
224 $this->
edits = $eng->diff( $from_lines, $to_lines );
249 foreach ( $this->
edits as $edit ) {
250 $rev->edits[] = $edit->reverse();
262 foreach ( $this->
edits as $edit ) {
263 if ( $edit->type !=
'copy' ) {
280 foreach ( $this->
edits as $edit ) {
281 if ( $edit->type ==
'copy' ) {
282 $lcs += count( $edit->orig );
300 foreach ( $this->
edits as $edit ) {
302 array_splice(
$lines, count(
$lines ), 0, $edit->orig );
320 foreach ( $this->
edits as $edit ) {
321 if ( $edit->closing ) {
322 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.
__construct( $orig, $closing)
__construct( $orig, $closing=false)
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.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global then executing the whole list after the page is displayed We don t do anything smart like collating updates to the same table or such because the list is almost always going to have just one item on if so it s not worth the trouble Since there is a job queue in the jobs which is used to update link tables of transcluding pages after edits
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev