Franz
Franz

Reputation: 11553

PHP class for parsing diffs

I am writing a PHP script that needs to interpret Diff files as created by Git. How should I proceed if I want to parse the Diff file and basically print it in a completely different format?

I have come across the Text_Diff PEAR library, but that one only creates the Diffs itself. Or rather, it only takes two different files as input. Is there a way to use that set of classes to achieve what I want (feed in a diff and get a tokenized diff as output, basically split up into the operations)?

Upvotes: 2

Views: 1122

Answers (1)

Emil Orol
Emil Orol

Reputation: 561

I will recommend you to take a look to the diff module drupal has, because the it use a Diff Engine class from a wiki that might be the solution you are looking for.

http://drupal.org/project/diff

Upvotes: 1

Related Questions