File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -3020,6 +3020,26 @@ public function _prefix( $value ) {}
3020
3020
*/
3021
3021
public function _unserialize ( $ value ) {}
3022
3022
3023
+ /**
3024
+ * A utility method to serialize values manually. This method allows you to serialize a value with whatever
3025
+ * serializer is configured, manually. This can be useful for serialization/unserialization of data going in
3026
+ * and out of EVAL commands as phpredis can't automatically do this itself. Note that if no serializer is
3027
+ * set, phpredis will change Array values to 'Array', and Objects to 'Object'.
3028
+ * @param mixed $value The value to be serialized.
3029
+ * @return mixed
3030
+ * @example
3031
+ * <pre>
3032
+ * $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE);
3033
+ * $redis->_serialize("foo"); // returns "foo"
3034
+ * $redis->_serialize(Array()); // Returns "Array"
3035
+ * $redis->_serialize(new stdClass()); // Returns "Object"
3036
+ *
3037
+ * $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
3038
+ * $redis->_serialize("foo"); // Returns 's:3:"foo";'
3039
+ * </pre>
3040
+ */
3041
+ public function _serialize ( $ value ) {}
3042
+
3023
3043
/**
3024
3044
* Dump a key out of a redis database, the value of which can later be passed into redis using the RESTORE command.
3025
3045
* The data that comes out of DUMP is a binary representation of the key as Redis stores it.
You can’t perform that action at this time.
0 commit comments