Follow-up to:
#120955: Integrate Diff into Core

Steps

  1. Compare DiffEngine.php with PhpWiki's original diff*.php files. Document all differences.
  2. Compare and merge DiffEngine.php with improvements in MediaWiki's DairikiDiff.php.
  3. Commit combined improvements.

Postponed until feature freeze. No reason to work on that before.

Comments

Alan D.’s picture

The only change of significance that I could see with the core Diff classes is below. I only compared the classes from the introduction of the file in 4.7. This was added between 7.x-2.x and 7.x-3.x and was done to introduce a way to count lines across multiple calls to the DiffFormatter class

<?php
class DiffFormatter {
// This was incorrectly defined in DrupalDiffFormatter...
+  var $line_stats = array(
+     
'counter' => array('x' => 0, 'y' => 0),
+     
'offset' => array('x' => 0, 'y' => 0),
+  );

  function
format($diff) {
.....
+
+    if (!empty(
$xi)) {
+     
$this->line_stats['counter']['x'] += $xi;
+    }
+    if (!empty(
$yi)) {
+     
$this->line_stats['counter']['y'] += $yi;
+    }
+
     return
$end;
   }
}
?>

As far as I could tell, all other changes were done in relation to coding standards, minor notices such as non-initialised variables, etc.

Alan D.’s picture

Flagged #1826156: Move to Text_Diff library as a duplicate from the Diff module queue.

Links to http://dev.horde.org/api/master/lib/Text_Diff/

Alan D.’s picture

Issue summary:View changes

Updated issue summary.

mgifford’s picture

Issue summary:View changes
Status:Postponed» Active

We're at Beta1 so assume this is a good time.