public function onReady()
{
if ($this->user === null) {
$this->connected = true;
}
if ($this->connected) {
parent::onReady();
return;
}
$this->dbname = $this->path;
$this->pool->saslScrumSHA1Auth(['user' => $this->user, 'password' => $this->password, 'dbname' => $this->dbname, 'conn' => $this], function ($result) {
if (!isset($result['ok']) || !$result['ok']) {
Daemon::log('MongoClient: authentication error with ' . $this->url . ': ' . $result['errmsg']);
$this->finish();
return;
}
$this->connected = true;
$this->onReady();
}, $this);
}