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


  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.


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

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

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.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.