Minor libmemcache issue inside php extension

John McCaskey johnm at klir.com
Tue Jan 18 09:25:45 PST 2005


I worked on a php extension wrapper for libmemcache over the weekend and
made good progress.  Currently get, set, replace, add, stats, and
add_server are all working. I still need to implement multi-gets, and I
need to consider whether the callback mechanism makes sense to implement
in php, as well as whether trying to implement persistent memcache()
objects makes sense for the initial release.

I did run into one minor issue, it seems that the %hu and %zu format
strings do not work.  I can only assume php is overriding my systems
snprintf as they always work outside of the php extension.  What is
happening is that they don't fail gracefully either, and they just
output SET key %zu 0 %hu or whatever to the server, which obviously

As such I'm currently working with having patched the
mcm_storage_command to just use %u in place of %hu and %zu.  

Maybe for portability it should just be changed to that?

I plan to clean up my php extension work and finish up the remaining
methods tonight.  Hopefully I'll post up an initial release by tommorow

John A. McCaskey
Software Development Engineer
Klir Technologies, Inc.
johnm at klir.com

More information about the memcached mailing list