protected function _write()
{
if ($this->serializationType == Constants::SERIALIZATION_SERIAL_BIN) {
throw new PhpOrientWrongProtocolVersionException('Serialization Type Binary not yet supported');
}
if (empty($this->username) && empty($this->password)) {
throw new PhpOrientBadMethodCallException('Can not begin a connection ' . 'without connection parameters');
}
$this->_writeString($this->clientName);
$this->_writeString($this->clientVersion);
$this->_writeShort($this->_transport->getProtocolVersion());
if ($this->_transport->getProtocolVersion() > 21) {
$this->_writeString($this->_clientID);
$this->_writeString($this->serializationType);
if ($this->_transport->getProtocolVersion() > 26) {
$this->_writeBoolean($this->_transport->isRequestToken());
# token
if ($this->_transport->getProtocolVersion() >= 36) {
$this->_writeBoolean(true);
# support-push
$this->_writeBoolean(true);
# collect-stats
}
}
$this->_writeString($this->username);
$this->_writeString($this->password);
} else {
$this->_writeString($this->_clientID);
$this->_writeString($this->username);
$this->_writeString($this->password);
}
}