Wow, what a fast answer.
Because i’m using directmongosuite and yiimongodbsuite, I don’t like to define mongo-DB-connection-infomration on different palaces.
So (as i wrote) I use the connectionId from yiimongodbsuiet for driectmongodbsuite. Look at this post #17 http://www.yiiframework.com/forum/index.php/topic/25356-extension-directmongosuite/page__view__findpost__p__142992
To get this work, I (right now) changed your instance method, as you can see:
public static function instance($connectionId)
{
if (!isset(self::$_instance))
self::$_instance = array();
if (!isset(self::$_instance[$connectionId]))
{
$component = Yii::app()->getComponent($connectionId);
if ($component instanceof EDMSConnection)
self::$_instance[$connectionId] = $component;
else //use YiiMongoDbSuite EMongoDB config
if ($component instanceof EMongoDB)
{
$connection = new EDMSConnection();
$connection->server = $component->connectionString;
$connection->dbName = $component->dbName;
/*next Line: using the replicationSet Parameter from YiiMongoDbSuite config*/
$connection->options["replicaSet"]=$component->replicaSet;
if ($component->autoConnect == false)
$connection->options['connect'] = false;
self::$_instance[$connectionId] = $connection;
}
else
throw new EDMSException("Invalid connectionId: $connectionId");
}
return self::$_instance[$connectionId];
}
Joblo - is this the right place to implement replacationSets (finally it works right now ).
I know, that it’s not best practice to change the code of an extension: i better should overwrite the method at an new class. Same think on slaveOkay topic. But the point is: I don’t need to add a new class to overwride your method, if the new release is coming soon.