|
php mcache exension: 1.1.0 features/fixes list: msg#00079web.cache.memcached
I've spent some time today working on the next version of
my php extension based off libmemcache. I'm posting the list of
changes/fixes I've come up with so far for community review and
comments.
Fixes:
1) In the intial release, bools, longs, doubles,
and strings were all returned as strings, due to the way types work in php this
would normally work fine, but now they return in the exact same type as they
were when you set them.
2) flags is not an option to set, add, or replace
commands. The flags field was never able to be retrieved from getcommand,
and it is used internally by the extension to keep track of types and
serialization. As such I think the best thing to do is not support it from
an end user perspective. If you need flags do something like
$mc->set('key', Array('val'->myvalue, 'flags'->myflags)); This
breaks the api for set, add, and replace, but its pretty trivial. The
version number will bump to 1.1.0 to indicate this.
Features:
1) Persistent memcache objects/connections.
The thing that is problematic is that you only want
to add each server once, I'm probably going to end up keeping track of which
servers have been added internally in the object, and then detecting duplicate
calls and ignoring them. Then it would look like:
<?
$mc = pmemcache('unique key for this
object');
if($mc) {
$mc->add_server('localhost', '11211'); // this is only actually
run the first time its called on the persistent object
//set/get/whatever as usual
}
?>
The only other option I came up with was to pass an array of servers to the
pmemcache() function itself, but I like not doing that as calling add_server as
stated in the above option seems more flexible in allowing new servers to be
added later without creating a new object.
Anyway, this is 99.9% functional (just need to fix duplicate calls to
add_server to not keep adding more connections), and I did some testing of it
tonight. I plan to get everything finished and tested within the next
couple of days and I'll push the code out to the site.
John
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | perl client and flush_all: 00079, Patrick Michael Kane |
|---|---|
| Next by Date: | Congrats Brad: 00079, Myles Grant |
| Previous by Thread: | perl client and flush_alli: 00079, Patrick Michael Kane |
| Next by Thread: | Congrats Brad: 00079, Myles Grant |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |