6.0.0-beta1
7/29/25

[#3725] allow associative arrays in text_diff
Summary allow associative arrays in text_diff
Queue Horde Framework Packages
Queue Version HEAD
Type Enhancement
State Rejected
Priority 1. Low
Owners
Requester vilius (at) lnk (dot) lt
Created 03/31/2006 (7060 days ago)
Due
Updated 11/16/2006 (6830 days ago)
Assigned
Resolved 11/16/2006 (6830 days ago)
Milestone
Patch No

History
11/16/2006 05:10:32 PM Chuck Hagenbuch Comment #11
State ⇒ Rejected
Reply to this comment
I'm rejecting this on the basis that it doesn't belong in Text_Diff. 
Nice array diffs might be something else, but I'd want a strong use 
case for it.
04/02/2006 04:27:49 PM Chuck Hagenbuch Comment #10 Reply to this comment
Jan - are you accepting this as something for Text_Diff, or for Horde_Array?
04/02/2006 09:46:28 AM Jan Schneider State ⇒ Accepted
 
04/02/2006 08:10:02 AM vilius (at) lnk (dot) lt Comment #9 Reply to this comment
I would, but I haven't wrote it yet. It's only in my head for a moment :)
04/02/2006 02:11:05 AM Chuck Hagenbuch Comment #8 Reply to this comment
If you against including it into Text_Diff, then maybe new
Horde_Array package would be possible. Just like we have Horde_String
on top of the different PHP string functions.
Like Horde_Array, in the Util package? Btw, are you going to submit 
the diff for this feature?
04/01/2006 08:11:15 AM vilius (at) lnk (dot) lt Comment #7 Reply to this comment
At least in my case array keys matters. So if data array from database 
will be returned in different order (for example array("id" => "1", 
"name" => "Pavel", "surname" => "Lescynskyj")) and I would want to 
differ it with array from xml file (array("id" => "1", "surname" => 
"Lescynskyj", "name" => "Pavel")) it should be the same.



If you against including it into Text_Diff, then maybe new Horde_Array 
package would be possible. Just like we have Horde_String on top of 
the different PHP string functions.
03/31/2006 08:35:30 PM Chuck Hagenbuch Comment #6 Reply to this comment
This functionality sounds interesting, but I don't think it belongs in 
a Text_* package. If you want it to just be handled like lines of 
text, though, then you can implode() them with \n.
03/31/2006 06:30:25 PM vilius (at) lnk (dot) lt Comment #5 Reply to this comment
Sooory, I completely messed things up.



$array1 = array("one" => "1", "two" => "2");

$array2 = array("one" => "2", "two" => "3");



should produce:

<del>1</del>

<ins>2</ins>

<del>2</del>

<ins>3</ins>



and

$array1 = array("one" => "1", "two" => "2");

$array2 = array("two" => "1", "one" => "2");



<del>1</del>

<ins>2</ins>

<del>2</del>

<ins>1</ins>
03/31/2006 06:15:54 PM vilius (at) lnk (dot) lt Comment #4 Reply to this comment
The main idea behind this is that I have my custom application, where 
I have one data array from XML file, and the other from database. 
Application imports XML file to database if there are new or changed 
entries. Basically I want to have nice GUI (like in Chora :)) with 
checkbox options what I want to import and what don't. So it would be 
handy to make such comparison with Text_Diff in the way I posted a 
comment earler.
03/31/2006 06:09:10 PM vilius (at) lnk (dot) lt Comment #3 Reply to this comment
Maybe:



1

2



?
03/31/2006 03:19:05 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
What would you expect with

$array2 = array("two" => "1", "one" => "2");
03/31/2006 01:24:06 PM vilius (at) lnk (dot) lt Comment #1
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ allow associative arrays in text_diff
Queue ⇒ Horde Framework Packages
State ⇒ New
Reply to this comment
Allow to compare associative arrays in Text_Diff package. Such as:



$array1 = array("one" => "1", "two" => "2");

$array2 = array("one" => "2", "two" => "3");



which should produse

<del>1</del>

2

<ins>3</ins>

Saved Queries