mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
translation changes in the Network dir
This commit is contained in:
parent
38180e8951
commit
29b874e739
5 changed files with 14 additions and 14 deletions
|
@ -380,7 +380,7 @@ class CakeRequest implements ArrayAccess {
|
||||||
$type = strtolower(substr($name, 2));
|
$type = strtolower(substr($name, 2));
|
||||||
return $this->is($type);
|
return $this->is($type);
|
||||||
}
|
}
|
||||||
throw new CakeException(__('Method %s does not exist', $name));
|
throw new CakeException(__d('cake', 'Method %s does not exist', $name));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -459,7 +459,7 @@ class CakeResponse {
|
||||||
return $this->_status;
|
return $this->_status;
|
||||||
}
|
}
|
||||||
if (!isset($this->_statusCodes[$code])) {
|
if (!isset($this->_statusCodes[$code])) {
|
||||||
throw new CakeException(__('Unknown status code'));
|
throw new CakeException(__d('cake', 'Unknown status code'));
|
||||||
}
|
}
|
||||||
return $this->_status = $code;
|
return $this->_status = $code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,7 +221,7 @@ class CakeSocket {
|
||||||
$buffer = fread($this->connection, $length);
|
$buffer = fread($this->connection, $length);
|
||||||
$info = stream_get_meta_data($this->connection);
|
$info = stream_get_meta_data($this->connection);
|
||||||
if ($info['timed_out']) {
|
if ($info['timed_out']) {
|
||||||
$this->setLastError(E_WARNING, __('Connection timed out'));
|
$this->setLastError(E_WARNING, __d('cake', 'Connection timed out'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return $buffer;
|
return $buffer;
|
||||||
|
|
|
@ -126,11 +126,11 @@ class HttpResponse implements ArrayAccess {
|
||||||
*/
|
*/
|
||||||
public function parseResponse($message) {
|
public function parseResponse($message) {
|
||||||
if (!is_string($message)) {
|
if (!is_string($message)) {
|
||||||
throw new SocketException(__('Invalid response.'));
|
throw new SocketException(__d('cake', 'Invalid response.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match("/^(.+\r\n)(.*)(?<=\r\n)\r\n/Us", $message, $match)) {
|
if (!preg_match("/^(.+\r\n)(.*)(?<=\r\n)\r\n/Us", $message, $match)) {
|
||||||
throw new SocketException(__('Invalid HTTP response.'));
|
throw new SocketException(__d('cake', 'Invalid HTTP response.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
list(, $statusLine, $header) = $match;
|
list(, $statusLine, $header) = $match;
|
||||||
|
@ -198,7 +198,7 @@ class HttpResponse implements ArrayAccess {
|
||||||
|
|
||||||
while ($chunkLength !== 0) {
|
while ($chunkLength !== 0) {
|
||||||
if (!preg_match("/^([0-9a-f]+) *(?:;(.+)=(.+))?\r\n/iU", $body, $match)) {
|
if (!preg_match("/^([0-9a-f]+) *(?:;(.+)=(.+))?\r\n/iU", $body, $match)) {
|
||||||
throw new SocketException(__('HttpSocket::_decodeChunkedBody - Could not parse malformed chunk.'));
|
throw new SocketException(__d('cake', 'HttpSocket::_decodeChunkedBody - Could not parse malformed chunk.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$chunkSize = 0;
|
$chunkSize = 0;
|
||||||
|
|
|
@ -211,7 +211,7 @@ class HttpSocket extends CakeSocket {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!is_resource($resource)) {
|
if (!is_resource($resource)) {
|
||||||
throw new SocketException(__('Invalid resource.'));
|
throw new SocketException(__d('cake', 'Invalid resource.'));
|
||||||
}
|
}
|
||||||
$this->_contentResource = $resource;
|
$this->_contentResource = $resource;
|
||||||
}
|
}
|
||||||
|
@ -364,7 +364,7 @@ class HttpSocket extends CakeSocket {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!App::import('Lib', $this->responseClass)) {
|
if (!App::import('Lib', $this->responseClass)) {
|
||||||
throw new SocketException(__('Class %s not found.', $this->responseClass));
|
throw new SocketException(__d('cake', 'Class %s not found.', $this->responseClass));
|
||||||
}
|
}
|
||||||
$responseClass = $this->responseClass;
|
$responseClass = $this->responseClass;
|
||||||
$this->response = new $responseClass($response);
|
$this->response = new $responseClass($response);
|
||||||
|
@ -535,10 +535,10 @@ class HttpSocket extends CakeSocket {
|
||||||
App::uses($authClass, $plugin . 'Network/Http');
|
App::uses($authClass, $plugin . 'Network/Http');
|
||||||
|
|
||||||
if (!class_exists($authClass)) {
|
if (!class_exists($authClass)) {
|
||||||
throw new SocketException(__('Unknown authentication method.'));
|
throw new SocketException(__d('cake', 'Unknown authentication method.'));
|
||||||
}
|
}
|
||||||
if (!method_exists($authClass, 'authentication')) {
|
if (!method_exists($authClass, 'authentication')) {
|
||||||
throw new SocketException(sprintf(__('The %s do not support authentication.'), $authClass));
|
throw new SocketException(sprintf(__d('cake', 'The %s do not support authentication.'), $authClass));
|
||||||
}
|
}
|
||||||
call_user_func_array("$authClass::authentication", array($this, &$this->_auth[$method]));
|
call_user_func_array("$authClass::authentication", array($this, &$this->_auth[$method]));
|
||||||
}
|
}
|
||||||
|
@ -564,10 +564,10 @@ class HttpSocket extends CakeSocket {
|
||||||
App::uses($authClass, $plugin. 'Network/Http');
|
App::uses($authClass, $plugin. 'Network/Http');
|
||||||
|
|
||||||
if (!class_exists($authClass)) {
|
if (!class_exists($authClass)) {
|
||||||
throw new SocketException(__('Unknown authentication method for proxy.'));
|
throw new SocketException(__d('cake', 'Unknown authentication method for proxy.'));
|
||||||
}
|
}
|
||||||
if (!method_exists($authClass, 'proxyAuthentication')) {
|
if (!method_exists($authClass, 'proxyAuthentication')) {
|
||||||
throw new SocketException(sprintf(__('The %s do not support proxy authentication.'), $authClass));
|
throw new SocketException(sprintf(__d('cake', 'The %s do not support proxy authentication.'), $authClass));
|
||||||
}
|
}
|
||||||
call_user_func_array("$authClass::proxyAuthentication", array($this, &$this->_proxy));
|
call_user_func_array("$authClass::proxyAuthentication", array($this, &$this->_proxy));
|
||||||
}
|
}
|
||||||
|
@ -785,7 +785,7 @@ class HttpSocket extends CakeSocket {
|
||||||
if (is_string($request)) {
|
if (is_string($request)) {
|
||||||
$isValid = preg_match("/(.+) (.+) (.+)\r\n/U", $request, $match);
|
$isValid = preg_match("/(.+) (.+) (.+)\r\n/U", $request, $match);
|
||||||
if (!$this->quirksMode && (!$isValid || ($match[2] == '*' && !in_array($match[3], $asteriskMethods)))) {
|
if (!$this->quirksMode && (!$isValid || ($match[2] == '*' && !in_array($match[3], $asteriskMethods)))) {
|
||||||
throw new SocketException(__('HttpSocket::_buildRequestLine - Passed an invalid request line string. Activate quirks mode to do this.'));
|
throw new SocketException(__d('cake', 'HttpSocket::_buildRequestLine - Passed an invalid request line string. Activate quirks mode to do this.'));
|
||||||
}
|
}
|
||||||
return $request;
|
return $request;
|
||||||
} elseif (!is_array($request)) {
|
} elseif (!is_array($request)) {
|
||||||
|
@ -803,7 +803,7 @@ class HttpSocket extends CakeSocket {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->quirksMode && $request['uri'] === '*' && !in_array($request['method'], $asteriskMethods)) {
|
if (!$this->quirksMode && $request['uri'] === '*' && !in_array($request['method'], $asteriskMethods)) {
|
||||||
throw new SocketException(__('HttpSocket::_buildRequestLine - The "*" asterisk character is only allowed for the following methods: %s. Activate quirks mode to work outside of HTTP/1.1 specs.', implode(',', $asteriskMethods)));
|
throw new SocketException(__d('cake', 'HttpSocket::_buildRequestLine - The "*" asterisk character is only allowed for the following methods: %s. Activate quirks mode to work outside of HTTP/1.1 specs.', implode(',', $asteriskMethods)));
|
||||||
}
|
}
|
||||||
return $request['method'] . ' ' . $request['uri'] . ' ' . $versionToken . "\r\n";
|
return $request['method'] . ' ' . $request['uri'] . ' ' . $versionToken . "\r\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue