Get slaveOkay setting for this connection
public getSlaveOkay ( ) : boolean | ||
Résultat | boolean | Returns the value of slaveOkay for this instance. |
public function testSlaveOkay() { $conn = new Mongo("mongodb://localhost", array("replicaSet" => true, "slaveOkay" => true)); $this->assertTrue($conn->getSlaveOkay()); $db = $conn->somedb; $this->assertTrue($db->getSlaveOkay()); $c = $db->somec; $this->assertTrue($c->getSlaveOkay()); $conn->setSlaveOkay(false); $this->assertFalse($conn->getSlaveOkay()); $this->assertTrue($db->getSlaveOkay()); $this->assertTrue($c->getSlaveOkay()); $db = $conn->somedb; $this->assertFalse($db->getSlaveOkay()); $c = $db->somec; $this->assertFalse($c->getSlaveOkay()); $db->setSlaveOkay(true); $this->assertTrue($db->getSlaveOkay()); $c->setSlaveOkay(true); $this->assertTrue($c->getSlaveOkay()); $conn->setSlaveOkay(true); $this->assertTrue($conn->getSlaveOkay()); }