[dev] Horde_Cache_file question

Chuck Hagenbuch chuck at horde.org
Mon Nov 8 21:06:58 PST 2004


Quoting Vijay Mahrra <vijay.mahrra at es.easynet.net>:

> My question: is there a reason that Horde_Cache does not 
> serialize/unserialize data automatically when a get/set call is made 
> to the class? I think it would be a bit easier to use if the action 
> of serializing data was within the Horde_Cache class.  I can submit a 
> patch if we are in agreement.

No. Automatically serializing/unserializing isn't a good idea unless you know
something about what kind of data you expect, and takes flexibility away from
the user. You could write a higher-level API that would take care of that if
you wanted.

Also, it's rather problematic to try unserializing everything and then return
the original string only if it doesn't work, on gets.

-chuck

-- 
"But she goes not abroad in search of monsters to destroy." - John 
Quincy Adams


More information about the dev mailing list