Extract a strategy class from the replication connection.

This commit is contained in:
Daniele Alessandri
2012-09-12 11:45:17 +02:00
parent b4e1ab106c
commit 732d7f96d1
6 changed files with 643 additions and 190 deletions
+5 -2
View File
@@ -21,6 +21,7 @@ require 'SharedConfigurations.php';
use Predis\Command\ScriptedCommand;
use Predis\Connection\MasterSlaveReplication;
use Predis\Profile\ServerProfile;
use Predis\Replication\ReplicationStrategy;
// ------------------------------------------------------------------------- //
@@ -57,8 +58,10 @@ $options = array(
return $profile;
},
'replication' => function ($options) {
$replication = new MasterSlaveReplication();
$replication->setScriptReadOnly(HashMultipleGetAll::BODY);
$strategy = new ReplicationStrategy();
$strategy->setScriptReadOnly(HashMultipleGetAll::BODY);
$replication = new MasterSlaveReplication($strategy);
return $replication;
},