[TASK] Updated variable names to lowerCamelCase.

This commit is contained in:
Jan Philipp Timme
2011-06-25 23:16:28 +00:00
parent 78866ed149
commit df030e453d
7 changed files with 103 additions and 103 deletions
+27 -27
View File
@@ -16,7 +16,7 @@ class Connection_ConnectionHandler {
* This buffer does not use a linebreak, it's a temporary store for data.
* @var Misc_Buffer
*/
protected $buffer_incoming;
protected $bufferIncoming;
/**
* Buffer that contains outgoing data.
@@ -24,7 +24,7 @@ class Connection_ConnectionHandler {
* This buffer does not use a linebreak, it's a temporary store for data.
* @var Misc_Buffer
*/
protected $buffer_outgoing;
protected $bufferOutgoing;
/**
* Contains the instance of the SocketHandler class.
@@ -42,7 +42,7 @@ class Connection_ConnectionHandler {
* A boolean that indicates whether this Connection is a listening server socket or a usual client socket.
* @var boolean
*/
protected $is_server;
protected $isServer;
/**
* Unique Connection ID.
@@ -79,7 +79,7 @@ class Connection_ConnectionHandler {
/**
* @var boolean
*/
protected $reconnect_on_disconnect;
protected $reconnectOnDisconnect;
/**
* Calls parent constructor.
@@ -88,16 +88,16 @@ class Connection_ConnectionHandler {
* @return void
*/
public function __construct($socket, $id, $group = "", $protocol = "") {
$this->buffer_incoming = new Misc_Buffer();
$this->buffer_outgoing = new Misc_Buffer();
$this->bufferIncoming = new Misc_Buffer();
$this->bufferOutgoing = new Misc_Buffer();
$this->socketHandler = new Socket_SocketHandler($socket);
$this->id = $id;
$this->group = $group;
$this->protocol = $protocol;
$this->is_server = FALSE;
$this->isServer = FALSE;
$this->host = "";
$this->port = 0;
$this->reconnect_on_disconnect = FALSE;
$this->reconnectOnDisconnect = FALSE;
$this->IPv6 = FALSE;
}
@@ -144,7 +144,7 @@ class Connection_ConnectionHandler {
* @return boolean
*/
public function isServer() {
return $this->is_server;
return $this->isServer;
}
/**
@@ -157,20 +157,20 @@ class Connection_ConnectionHandler {
}
/**
* Sets reconnect_on_disconnect flag.
* Sets reconnectOnDisconnect flag.
* @param boolean $reconnect
* @return void
*/
public function setReconnect($reconnect) {
$this->reconnect_on_disconnect = $reconnect;
$this->reconnectOnDisconnect = $reconnect;
}
/**
* Gets reconnect_on_disconnect flag.
* Gets reconnectOnDisconnect flag.
* @return boolean
*/
public function getReconnect() {
return $this->reconnect_on_disconnect;
return $this->reconnectOnDisconnect;
}
/**
@@ -184,7 +184,7 @@ class Connection_ConnectionHandler {
}
/**
* Reads from SocketHandler, writes into buffer_incoming.
* Reads from SocketHandler, writes into bufferIncoming.
* Returns a boolean that will indicate whether the socket is still okay.
* @throws Exception_SocketException
* @return boolean
@@ -196,18 +196,18 @@ class Connection_ConnectionHandler {
$this->shutdown();
return FALSE;
}
$this->buffer_incoming->addData($data);
$this->bufferIncoming->addData($data);
return TRUE;
}
/**
* Writes the buffer_outgoing to the SocketHandler.
* Writes the bufferOutgoing to the SocketHandler.
* Returns a boolean that will indicate whether the socket is still okay.
* @throws Exception_SocketException
* @return boolean
*/
public function writeFromBuffer() {
$bufferContent = $this->buffer_outgoing->getAllBufferContents();
$bufferContent = $this->bufferOutgoing->getAllBufferContents();
//this might not be cool, but it should do.
if($bufferContent === "") return TRUE;
$result = $this->socketHandler->write($bufferContent);
@@ -232,7 +232,7 @@ class Connection_ConnectionHandler {
* @return boolean
*/
public function canRead() {
return $this->buffer_incoming->hasData();
return $this->bufferIncoming->hasData();
}
/**
@@ -240,26 +240,26 @@ class Connection_ConnectionHandler {
* @return boolean
*/
public function canWrite() {
return $this->buffer_outgoing->hasData();
return $this->bufferOutgoing->hasData();
}
/**
* Reads new data into buffer_incoming.
* Returns a full line from buffer_incoming.
* Reads new data into bufferIncoming.
* Returns a full line from bufferIncoming.
* @return string
*/
public function read() {
return $this->buffer_incoming->getAllBufferContents();
return $this->bufferIncoming->getAllBufferContents();
}
/**
* Writes data into buffer_outgoing.
* Sends data from buffer_outgoing to the SocketHandler.
* Writes data into bufferOutgoing.
* Sends data from bufferOutgoing to the SocketHandler.
* @param $data
* @return void
*/
public function write($data) {
$this->buffer_outgoing->addData($data);
$this->bufferOutgoing->addData($data);
}
/**
@@ -324,7 +324,7 @@ class Connection_ConnectionHandler {
* @return Connection_ConnectionHandler
*/
public function reconnect() {
if($this->reconnect_on_disconnect === FALSE) throw new Exception_GeneralException("Cannot reconnect: Reconnect-Flag not set!", 1290951385);
if($this->reconnectOnDisconnect === FALSE) throw new Exception_GeneralException("Cannot reconnect: Reconnect-Flag not set!", 1290951385);
if(empty($this->host) === TRUE) throw new Exception_GeneralException("Cannot reconnect: No host specified.", 1290950818);
if(empty($this->port) === TRUE) throw new Exception_GeneralException("Cannot reconnect: No port specified.", 1290950844);
$newConnectionHandler = $this->connectionPool->createTcpConnection($this->group, $this->protocol, $this->IPv6);
@@ -352,7 +352,7 @@ class Connection_ConnectionHandler {
* @return void
*/
public function listen() {
$this->is_server = TRUE;
$this->isServer = TRUE;
return $this->socketHandler->listen();
}