You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Redis.php
+24-7Lines changed: 24 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -210,14 +210,31 @@ public function get( $key ) {}
210
210
/**
211
211
* Set the string value in argument as value of the key.
212
212
*
213
-
* @param string $key
214
-
* @param string $value
215
-
* @param int $ttl Calling setex() is preferred if you want a Time To Live.
216
-
* @return bool: If the command is successful return TRUE or 'Redis Socket Buffer' object
217
-
* @link http://redis.io/commands/set
218
-
* @example $redis->set('key', 'value');
213
+
* @since If you're using Redis >= 2.6.12, you can pass extended options as explained in example
214
+
*
215
+
* @param string $key
216
+
* @param string $value
217
+
* @param int|array $timeout If you pass an integer, phpredis will redirect to SETEX, and will try to use Redis >= 2.6.12 extended options if you pass an array with valid values
218
+
*
219
+
* <pre>
220
+
* // Simple key -> value set
221
+
* $redis->set('key', 'value');
222
+
*
223
+
* // Will redirect, and actually make an SETEX call
224
+
* $redis->set('key','value', 10);
225
+
*
226
+
* // Will set the key, if it doesn't exist, with a ttl of 10 seconds
0 commit comments