PHP8.4 Deprecation stream_context_set_option -> stream_context_set_options
This commit is contained in:
@@ -123,7 +123,11 @@ class Smtp
|
|||||||
$this->putLine("STARTTLS\r\n");
|
$this->putLine("STARTTLS\r\n");
|
||||||
$context["ssl"]["verify_peer_name"] = $this->starttlsCheck;
|
$context["ssl"]["verify_peer_name"] = $this->starttlsCheck;
|
||||||
$context["ssl"]["verify_peer"] = $this->starttlsCheck;
|
$context["ssl"]["verify_peer"] = $this->starttlsCheck;
|
||||||
|
if (version_compare(PHP_VERSION, '8.3.0') <= 0) {
|
||||||
stream_context_set_option($this->smtpStream, $context);
|
stream_context_set_option($this->smtpStream, $context);
|
||||||
|
} else {
|
||||||
|
stream_context_set_options($this->smtpStream, $context);
|
||||||
|
}
|
||||||
// The track_errors permit to create the $php_errormsg in case of
|
// The track_errors permit to create the $php_errormsg in case of
|
||||||
// warning
|
// warning
|
||||||
ini_set('track_errors', 1);
|
ini_set('track_errors', 1);
|
||||||
|
|||||||
@@ -246,9 +246,14 @@ class Tcpclient
|
|||||||
"capture_peer_cert_chain" => true,
|
"capture_peer_cert_chain" => true,
|
||||||
"SNI_enabled" => true,
|
"SNI_enabled" => true,
|
||||||
]];
|
]];
|
||||||
|
$optionsMerged = [];
|
||||||
$optionsMerged["ssl"] = array_merge($optionsBase["ssl"], $options);
|
$optionsMerged["ssl"] = array_merge($optionsBase["ssl"], $options);
|
||||||
stream_set_blocking($this->socket, true);
|
stream_set_blocking($this->socket, true);
|
||||||
|
if (version_compare(PHP_VERSION, '8.3.0') <= 0) {
|
||||||
stream_context_set_option($this->socket, $optionsMerged);
|
stream_context_set_option($this->socket, $optionsMerged);
|
||||||
|
} else {
|
||||||
|
stream_context_set_options($this->socket, $optionsMerged);
|
||||||
|
}
|
||||||
$php_errormsg = "";
|
$php_errormsg = "";
|
||||||
ini_set("track_errors", 1);
|
ini_set("track_errors", 1);
|
||||||
$rc = @stream_socket_enable_crypto($this->socket, !!$val, $cryptoMethod);
|
$rc = @stream_socket_enable_crypto($this->socket, !!$val, $cryptoMethod);
|
||||||
|
|||||||
@@ -496,7 +496,11 @@ class Tcpserver
|
|||||||
"verify_peer_name" => false,
|
"verify_peer_name" => false,
|
||||||
]];
|
]];
|
||||||
stream_set_blocking($this->socket, true);
|
stream_set_blocking($this->socket, true);
|
||||||
|
if (version_compare(PHP_VERSION, '8.3.0') <= 0) {
|
||||||
stream_context_set_option($this->socket, $options);
|
stream_context_set_option($this->socket, $options);
|
||||||
|
} else {
|
||||||
|
stream_context_set_options($this->socket, $options);
|
||||||
|
}
|
||||||
return @stream_socket_enable_crypto($this->socket, !!$val, $cryptoMethod);
|
return @stream_socket_enable_crypto($this->socket, !!$val, $cryptoMethod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user