Proposal for "Diff"

» Metadata » Status
  • Category: Text
  • Proposer: Paul Jones 
  • License: LGPL
» Description
Proposal: Text_Diff


The Text_Diff engine parses two text sources line-by-line and builds an object-oriented structure of the differences between the two. The structure object can then itself be parsed into "standard" diff format or otherwise parsed into HTML to highlight add, copy, delete, and change elements. Text_Diff also supports 3-way diffs.

This package is useful because not all environments have access to a native "diff" call. Those which do must write to the file system and diff on those files, which is not always optimal or secure. Thus, Text_Diff allows developers to compute diffs regardless of environment.


I am only a proxy for this package; I am NOT the author. Text_Diff was originally written by Geoffrey T. Dairiki and licensed LGPL. It was then imported into the Horde library and PEAR-ified by Chuck Hagenbuch and Jon Parise.

With Chuck and Jon's approval, all I propose here is that the Text_Diff package be imported as a PEAR package (proper) for common usage. The CVS sources will continue to be maintined at Horde, and contributors are encouraged to submit patches to Horde. As changes are committed there, I will from time to time roll new packages of Text_Diff for PEAR.


Need more serious documentation, which I am willing to host at (or similar site).

Need more examples, although the single example included in the package is quite sufficient for getting started.

More renderers would be nice.
» Dependencies » Links
» Timeline » Changelog
  • First Draft: 2004-04-04
  • Proposal: 2004-04-04
  • Call for Votes: 2004-04-12