Skip to content
Permalink
Browse files

Fix PHP 5.3 incompatibilities, some formatting

fixes #218
  • Loading branch information...
LarsMichelsen committed Nov 1, 2019
1 parent ae01e27 commit e7acb9dfea398c0348ac04487c8b2040127d9140
Showing with 22 additions and 20 deletions.
  1. +22 −20 share/server/core/classes/GlobalBackendmklivestatus.php
@@ -196,33 +196,35 @@ private function connectSocket() {
} elseif($this->socketType === 'tcp-tls') {
if (cfg('backend_'.$this->backendId, 'verify_tls_peer') == true) {
$ssl_options = [
'verify_peer' => true,
'verify_peer_name' => false,
'verify_depth' => 1,
];
$ca_path = cfg('backend_'.$this->backendId, 'verify_tls_ca_path');
if ($ca_path)
$ssl_options['cafile'] = $ca_path;
$ssl_options = Array(
'verify_peer' => true,
'verify_peer_name' => false,
'verify_depth' => 1,
);
$context = stream_context_create([
$ca_path = cfg('backend_'.$this->backendId, 'verify_tls_ca_path');
if ($ca_path)
$ssl_options['cafile'] = $ca_path;
$context = stream_context_create(Array(
'ssl' => $ssl_options
]);
} else {
$context = stream_context_create([
'ssl' => [
));
} else {
$context = stream_context_create(Array(
'ssl' => Array(
'verify_peer' => false,
'verify_peer_name' => false
]
]);
}
)
));
}
$this->SOCKET= stream_socket_client("tls://" . $this->socketAddress . ":" . $this->socketPort, $errno, $errstr,
(float) cfg('backend_'.$this->backendId, 'timeout'), STREAM_CLIENT_CONNECT, $context);
$this->SOCKET= stream_socket_client(
"tls://" . $this->socketAddress . ":" . $this->socketPort, $errno, $errstr,
(float) cfg('backend_'.$this->backendId, 'timeout'), STREAM_CLIENT_CONNECT,
$context);
} elseif($this->socketType === 'tcp') {
$this->SOCKET = fsockopen($this->socketAddress, $this->socketPort, $errno, $errstr, (float) cfg('backend_'.$this->backendId, 'timeout'));
$this->SOCKET = fsockopen($this->socketAddress, $this->socketPort, $errno, $errstr,
(float) cfg('backend_'.$this->backendId, 'timeout'));
}
restore_error_handler();

0 comments on commit e7acb9d

Please sign in to comment.
You can’t perform that action at this time.