28 okt 2008 kl. 23.56 skrev Chris:
1) Store the "delta" (=the actual change) of a text change. This
could be done by utilizing the Pear package TextDiff. My idea was
to compare the old with the new text with help of the TextDiff
class. I would then grab the array containing the changes from
TextDiff, serialize it and store this data into the db. The problem
is that this is every thing else but efficient when it comes to
smaller text (the serialized array holding the changes was actually
larger than the two texts combined).
What happens when you want to restore a particular version? You have
to go through each edition and apply patches. Could get very messy.
Not only that. What would happen if they update TextDiff and all
stored serialized arrays got obsolete? The system is aimed to store
documents for several years to come. Besides that, doing some advanced
search in the "history/revision" table would be very difficult.
I'd say you're on the right track in just storing each version.
2) Do some kind of compression on the text to be stored. However,
it seems that the build-in compression functions from PHP5 are more
efficient when it comes to large texts.
All compression techniques (in or out of php) will work better on
more text.
I noticed that too.
//frank
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php