[IPB 2.1] Template Set Differences

It’s still early days, but here’s something I’ve thrown together this afternoon.

Originally, I was going to write a quick and dirty script to compare two ipb_template.xml files together and show a list of differences. I would re-format those differences and post them with a release announcement showing exactly which template bits had changed and which HTML bits had changed.

I then considered how useful this would be in a general sense. Wouldn’t it be nice if you could upload any ipb_template.xml file and have it compared to the current master HTML templates? Not only is this useful for just comparing changes between version releases, it’s also handy to generate a list of the actual HTML edits to your own custom skins for safe keeping.

This is the result. It’s fairly scrappy at the moment and the interface will be cleaned up as well as previous comparison results saved to the DB for hard reference.

This feature didn’t take too long to put together as I had already written a difference engine for IP.Dynamic - although the current difference engine won’t work for safe_mode enabled folks; something that will be working on as our adventure continues.

ACP Diff Overview (JPG)
ACP Diff View Bit (JPG)

Nice idea Matt!
:)

Yes, nice idea.
But when can we have the final release!
We can’t wait!

What sort of functionality are you using that isn’t allowed by safe_mode to diff two strings? I would think you would just need some basic logic to do so, not to hit the filesystem or anything crazy like that.

I’m using the difference engine from IP.D which runs via the UNIX “diff” command. I also have a CGI file to run the “diff” command for safe_mode folks, I will either enable that or write a PHP diff engine.

Oh, that’s no fun :P

What about Windows users, then? I think you’ll have to write the diff engine in PHP, to be honest. Of course, it doesn’t look that hard if you do it on a line-by-line basis: http://www.holomind.de/phpnet/diff.src.php

Cybertimber2005

Ok… so basically it can tell you the diffrences between a custom edited 2.0.x skin and a 2.1.0?

Could it also be made to create a “recommended changes/updates” XML file? That would make updating/upgrading skins from v2.0.x to v2.1.x a snap. :)
And it is an excellant idea Matt. You would think of it.

Wicked!

Nice. Looking good, Matt. ;)

Oh! Good idea!!

Tim Dorr,

That diff class looks too simplistic and has hard limitations (will only look 10 lines for a match), etc.

I’ve just included the LGPL Pear:Text-Diff class in the ips_kernel folder and we’ll just use that. The LGPL differs as it allows dynamic or static linking of libraries without the need for the entire software to be GPL.

In the fullness of time, I’ll write my own DIFF engine.

Oh, of course. I wasn’t suggesting something *that* simple, but just pointing out it shouldn’t be that hard to do.

Of course, Text_Diff’s done all the work, so why bother! Just make sure you follow that LGPL to a T. We don’t want to get into another phpMyAdmin fiasco again :S

LGPL is much less restrictive and as long as the whole of the work is just linked to and not incorporated into the core program then the core program does not have to be released as GPL.

“. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a “work that uses the Library”. Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.”

This is probably the best example of a difference example that I’ve seen. There has always been a two-pane view of both documents with empty lines with red/green font. Thanks for the information on where you found a script to do this, I’ve been trying to root around google results and nothing was ever good enough.

*
To prove that you're not a bot, enter this code
Anti-Spam Image