mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Simplified the CakeSocket and fixed some phpdocs.
This commit is contained in:
parent
fb5495fad5
commit
8c29847c8f
1 changed files with 7 additions and 18 deletions
|
@ -138,9 +138,8 @@ class CakeSocket {
|
|||
public function host() {
|
||||
if (Validation::ip($this->config['host'])) {
|
||||
return gethostbyaddr($this->config['host']);
|
||||
} else {
|
||||
return gethostbyaddr($this->address());
|
||||
}
|
||||
return gethostbyaddr($this->address());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -151,9 +150,8 @@ class CakeSocket {
|
|||
public function address() {
|
||||
if (Validation::ip($this->config['host'])) {
|
||||
return $this->config['host'];
|
||||
} else {
|
||||
return gethostbyname($this->config['host']);
|
||||
}
|
||||
return gethostbyname($this->config['host']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -164,9 +162,8 @@ class CakeSocket {
|
|||
public function addresses() {
|
||||
if (Validation::ip($this->config['host'])) {
|
||||
return array($this->config['host']);
|
||||
} else {
|
||||
return gethostbynamel($this->config['host']);
|
||||
}
|
||||
return gethostbynamel($this->config['host']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -177,9 +174,8 @@ class CakeSocket {
|
|||
public function lastError() {
|
||||
if (!empty($this->lastError)) {
|
||||
return $this->lastError['num'] . ': ' . $this->lastError['str'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -187,6 +183,7 @@ class CakeSocket {
|
|||
*
|
||||
* @param integer $errNum Error code
|
||||
* @param string $errStr Error string
|
||||
* @return void
|
||||
*/
|
||||
public function setLastError($errNum, $errStr) {
|
||||
$this->lastError = array('num' => $errNum, 'str' => $errStr);
|
||||
|
@ -230,17 +227,8 @@ class CakeSocket {
|
|||
return false;
|
||||
}
|
||||
return $buffer;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Abort socket operation.
|
||||
*
|
||||
* @return boolean Success
|
||||
*/
|
||||
public function abort() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -273,6 +261,7 @@ class CakeSocket {
|
|||
/**
|
||||
* Resets the state of this Socket instance to it's initial state (before Object::__construct got executed)
|
||||
*
|
||||
* @param array $state Array with key and values to reset
|
||||
* @return boolean True on success
|
||||
*/
|
||||
public function reset($state = null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue