mirror of
https://github.com/predis/predis.git
synced 2026-08-24 15:49:28 +00:00
Change Predis\Commands\Preprocessors to Predis\Command\Processors.
This commit is contained in:
@@ -2,16 +2,16 @@
|
||||
|
||||
require 'SharedConfigurations.php';
|
||||
|
||||
// Predis ships with a KeyPrefixPreprocessor class that is used to transparently
|
||||
// Predis ships with a KeyPrefixProcessor class that is used to transparently
|
||||
// prefix each key before sending commands to Redis, even for complex commands
|
||||
// such as SORT, ZUNIONSTORE and ZINTERSTORE. Key prefixes are useful to create
|
||||
// user-level namespaces for you keyspace, thus eliminating the need for separate
|
||||
// logical databases.
|
||||
|
||||
use Predis\Commands\Preprocessors\KeyPrefixPreprocessor;
|
||||
use Predis\Commands\Processors\KeyPrefixProcessor;
|
||||
|
||||
$client = new Predis\Client();
|
||||
$client->getProfile()->setPreprocessor(new KeyPrefixPreprocessor('nrk:'));
|
||||
$client->getProfile()->setProcessor(new KeyPrefixProcessor('nrk:'));
|
||||
|
||||
$client->mset(array('foo' => 'bar', 'lol' => 'wut'));
|
||||
var_dump($client->mget('foo', 'lol'));
|
||||
|
||||
Reference in New Issue
Block a user