Posted by sun on November 22, 2012 at 10:57pm
7 followers
Jump to:
| Project: | Drupal core |
| Version: | 8.x-dev |
| Component: | base system |
| Category: | task |
| Priority: | normal |
| Assigned: | sun |
| Status: | postponed |
| Issue tags: | diff |
Issue Summary
Follow-up to:
#120955: Integrate Diff into Core
Steps
- Compare DiffEngine.php with PhpWiki's original diff*.php files. Document all differences.
- Compare and merge DiffEngine.php with improvements in MediaWiki's DairikiDiff.php.
- Commit combined improvements.
Postponed until feature freeze. No reason to work on that before.
Comments
#1
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.