Text Diff for wikipedia type feature
Moderator: General Moderators
Text Diff for wikipedia type feature
Hey guys,
I'm trying to put together a wikipedia type feature for a project..
I've gone through pretty much every text diffing script I could find on google, but I haven't found anything easy to use...
wikimedia : 'difference engine' .. very complex -- forget about it.
pear: 'text_diff' .. doesn't seem to work that well, maybe I'm confused.
anybody have suggestions on this?
I'm trying to put together a wikipedia type feature for a project..
I've gone through pretty much every text diffing script I could find on google, but I haven't found anything easy to use...
wikimedia : 'difference engine' .. very complex -- forget about it.
pear: 'text_diff' .. doesn't seem to work that well, maybe I'm confused.
anybody have suggestions on this?
Basically it will manage all the versioning tasks for you... though interfacing with it could be somewhat hard to implement. There's php_svn extension in pecl - you could try that before resorting to pear's VersionControl_SVN. Though you will still need to parse diffs produced by svn somehow.arpowers wrote:I will check out SVN and diffparser...
btw, websvn might be of interest too: http://websvn.tigris.org/
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Thanks again for the replies.. kieren, weirdan
To follow,
I got the pear 'text_diff' working but isn't seeming to do what we want.. just returning changed lines in an array?
I assume some of our colleagues here have built something like this before??
its simply need a class or script that can take to text files, one old & with changes and find the differences between them... on a 'character by character' basis.
Everything I've looked at so far get changed lines.. which in itself can be screwed up if text is added and a new line is created..
as always.. you guys are awesome! thanks for the help
ap
also I don't understand why all the pear stuff needs to be written in php 4 syntax?
To follow,
I got the pear 'text_diff' working but isn't seeming to do what we want.. just returning changed lines in an array?
I assume some of our colleagues here have built something like this before??
its simply need a class or script that can take to text files, one old & with changes and find the differences between them... on a 'character by character' basis.
Everything I've looked at so far get changed lines.. which in itself can be screwed up if text is added and a new line is created..
as always.. you guys are awesome! thanks for the help
ap
also I don't understand why all the pear stuff needs to be written in php 4 syntax?
good question..
basically just because I know its been done in the past, and I would like to build a solid system..
lately, though I've been thinking of figuring out the line to line implementation and then figuring the rest out later...
this little feature is more complicated than I initially thought!
basically just because I know its been done in the past, and I would like to build a solid system..
lately, though I've been thinking of figuring out the line to line implementation and then figuring the rest out later...
this little feature is more complicated than I initially thought!
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
the unix command bdiff might be what you're looking for.
[url=http://ca.php.net/manual/en/function.shell-exec.php]shell_exec()[url] will give PHP access to the result, though you'll have to create temp files to feed to bdiff.
[url=http://ca.php.net/manual/en/function.shell-exec.php]shell_exec()[url] will give PHP access to the result, though you'll have to create temp files to feed to bdiff.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Wow, finally a really nice solution to this problem...
The 'text_diff' solution from PEAR was the right idea...
Once I implemented this, It wasn't working how I would like, but I found a slightly hacked/modified version that converted the line parameter to a word parameter and rendered it...
output is really nice.
http://software.zuavra.net/inline-diff/
for future reference, I don't think the differenceEngine from wikimedia is a good solution to this problem, if you look at their code it is quite long and hard to understand (quickly) ...
the PEAR library is the way to go for the php solution..
Thanks for your help... great support from you guys..
AP
The 'text_diff' solution from PEAR was the right idea...
Once I implemented this, It wasn't working how I would like, but I found a slightly hacked/modified version that converted the line parameter to a word parameter and rendered it...
output is really nice.
http://software.zuavra.net/inline-diff/
for future reference, I don't think the differenceEngine from wikimedia is a good solution to this problem, if you look at their code it is quite long and hard to understand (quickly) ...
the PEAR library is the way to go for the php solution..
Thanks for your help... great support from you guys..
AP
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact: