Skip to content

Commit

Permalink
remove SERIALIZER_NONE
Browse files Browse the repository at this point in the history
  • Loading branch information
yuqing committed Aug 24, 2018
1 parent 94bdb58 commit de07855
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ other features are:
* provide abundant stats info: counters for set, get and delete,
memory recycle stats, lock stats etc.
* support atomic increment
* PHP extension support multiple serializers: igbinary, msgpack, php and NONE.
* PHP extension support multiple serializers: igbinary, msgpack, php.
these serializers can coexist in a share memory.

utility commands in directory: src/tools, in /usr/bin/ after make && make install
Expand All @@ -55,7 +55,6 @@ ShmCache::__construct(string $config_filename[, long $serializer =
ShmCache::SERIALIZER_IGBINARY for igbinary, the default serializer
ShmCache::SERIALIZER_MSGPACK for msgpack
ShmCache::SERIALIZER_PHP for php serializer
ShmCache::SERIALIZER_NONE only support string variable
</pre>
* @throws ShmCacheException if the serializer not enabled
* @example: $cache = new ShmCache("/etc/libshmcache.conf");
Expand Down
2 changes: 1 addition & 1 deletion php-shmcache/serializer/shmcache_serializer.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ igbinary_serialize_func igbinary_pack_func = NULL;
igbinary_unserialize_func igbinary_unpack_func = NULL;

int shmcache_serializers = SHMCACHE_SERIALIZER_STRING |
SHMCACHE_SERIALIZER_INTEGER |
SHMCACHE_SERIALIZER_LIST |
SHMCACHE_SERIALIZER_MAP |
SHMCACHE_SERIALIZER_INTEGER |
SHMCACHE_SERIALIZER_PHP;

extern int shmcache_php_pack(zval *pzval, smart_str *buf);
Expand Down
4 changes: 2 additions & 2 deletions src/shmcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,12 +994,12 @@ const char *shmcache_get_serializer_label(const int serializer)
switch (serializer) {
case SHMCACHE_SERIALIZER_STRING:
return "string";
case SHMCACHE_SERIALIZER_INTEGER:
return "integer";
case SHMCACHE_SERIALIZER_LIST:
return "list";
case SHMCACHE_SERIALIZER_MAP:
return "map";
case SHMCACHE_SERIALIZER_INTEGER:
return "integer";
case SHMCACHE_SERIALIZER_MSGPACK:
return "msgpack";
case SHMCACHE_SERIALIZER_IGBINARY:
Expand Down
6 changes: 3 additions & 3 deletions src/shmcache_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
#define SHMCACHE_NEVER_EXPIRED 0

#define SHMCACHE_SERIALIZER_STRING 0x1 //string type
#define SHMCACHE_SERIALIZER_INTEGER (SHMCACHE_SERIALIZER_STRING | 0x2) //integer type
#define SHMCACHE_SERIALIZER_LIST (SHMCACHE_SERIALIZER_STRING | 0x4) //list
#define SHMCACHE_SERIALIZER_MAP (SHMCACHE_SERIALIZER_STRING | 0x8) //map
#define SHMCACHE_SERIALIZER_LIST (SHMCACHE_SERIALIZER_STRING | 0x2) //list
#define SHMCACHE_SERIALIZER_MAP (SHMCACHE_SERIALIZER_STRING | 0x4) //map
#define SHMCACHE_SERIALIZER_INTEGER (SHMCACHE_SERIALIZER_STRING | 0x8) //integer type
#define SHMCACHE_SERIALIZER_IGBINARY 0x200
#define SHMCACHE_SERIALIZER_MSGPACK 0x400
#define SHMCACHE_SERIALIZER_PHP 0x800
Expand Down

0 comments on commit de07855

Please sign in to comment.