|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesphp_memcache.h (last revision 2012-10-13 06:05 UTC by stevenschow at yahoo dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-10-26 20:24 UTC] adam at adamhahn dot com
[2012-11-04 19:33 UTC] hradtke@php.net
[2012-11-04 19:34 UTC] hradtke@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: hradtke
[2012-11-04 19:34 UTC] hradtke@php.net
[2012-11-04 19:35 UTC] hradtke@php.net
[2012-11-04 19:43 UTC] hradtke@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 20 05:00:01 2025 UTC |
Description: ------------ Sometimes it can be useful to store some data in the memcache flags. For example, if one has a compression or encoding you'd like to use besides the built in php serialized (indicated by "MMC_SERIALIZED") or MMC_COMPRESSED it can be useful to pass in an additional flag setting into memcache->set and get. This already works as described however there is no guarantee that future versions of pecl-memcache will not use the same flags an application has choosen to use. My feature request is simply to explicitly reserve some range of the flags and add some comments and/or defines in php_memcache.h (and php docs) so that applications know which flags they can use safely. For example add something like this to php_memcache.h just after MMC_COMPRESSED: // These flags are set here to reserve the for use by users of the pecl-memcache set and get #define MMC_RESERVED_FLAGS_APPLICATIONDEFINED_12 4096 // 1<<12 #define MMC_RESERVED_FLAGS_APPLICATIONDEFINED_13 8192 // 1<<13 #define MMC_RESERVED_FLAGS_APPLICATIONDEFINED_14 16384 // 1<<14 #define MMC_RESERVED_FLAGS_APPLICATIONDEFINED_15 32768 // 1<<15 Test script: --------------- $m = new Memcache(); define('MEMCACHE_APPFLAG_JSON', 4096); $flags = MEMCACHE_APPFLAG_JSON; $flags = $flags | MEMCACHE_COMPRESSED; $m->set("testkey", "testvalue", $flags); $getflags = 0; $m->get("testkey", $getflags); // At this point we know that I can get MEMCACHE_APPFLAG_JSON back out without // worrying that a newer version of php_memcache may have inadvertantly // used the same bit for something else.