[dev] Issue with Text_Diff threeway

Jan Schneider jan at horde.org
Mon Sep 26 16:42:37 UTC 2011


Zitat von Jason Margolin <jmargolin at digitalspy.co.uk>:

> Hi,
>
> The Text_Diff library is great, we use the native engine and the
> unified renderer to output diff's on web pages (v1.0.1 from
> pear.horde.org).
>
> The problem is we want to use the threeway diff, however we can't get
> it to work with the unified renderer.
>
> We use this at the moment to output the lines that have been
> added/deleted for two way:
>
> $diff = new Horde_Text_Diff('native', array($lines1, $lines2));
> $renderer = new Horde_Text_Diff_Renderer_Unified();
> echo $renderer->render($diff);
>
> For threeway we changed the $diff line to:
>
> $diff = new Horde_Text_Diff_ThreeWay($lines1, $lines2, $lines3);
>
> The $lines variables all being arrays of data split by line.
>
> This however does not output the line differences, just the blockHeader.
>
> In the threeway code there is a function called mergedOutput() which
> returns an array, but this doesn't go through the renderer so we don't
> know which lines have been added/deleted.

This sounds like a bug then. Can you please create a ticket on  
bugs.horde.org and upload a small test case?

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the dev mailing list