I'm trying to create two Predis\Client instances on the same PHP script to separate data belonging to different logical domains.
I do this as follows:
$param1 = [
'host' => 'localhost',
'port' => 6379,
'database' => 1,
];
$param2 = [
'host' => 'localhost',
'port' => 6379,
'database' => 3,
];
[... some code ...]
$redis1 = new Predis\Client($param1);
$redis2 = new Predis\Client($param2);
Here is the problem:
$redis1
correctly stores data into database 1$redis2
stores data into database 0 instead of 3
Do you have any idea why this happens?