restore

PHP Redis

restore

Description

Restore a key from the result of a DUMP operation.

恢复DUMP函数销毁的VALUE到一个新的KEY上。

Parameters

key string. The key name
ttl integer. How long the key should live (if zero, no expire will be set on the key)
value string (binary). The Redis encoded key value (from DUMP)

Examples
$redis->set('foo', 'bar');
$val = $redis->dump('foo');
$redis->restore('bar', 0, $val); // The key 'bar', will now be equal to the key 'foo'