mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Deprecate SoapClient ssl_method option
Instead use ssl stream context options instead. The direct equivalent would be crypto_method, but min_proto_version / max_proto_version are recommended instead. Part of https://wiki.php.net/rfc/deprecations_php_8_1.
This commit is contained in:
@@ -406,6 +406,13 @@ PHP 8.1 UPGRADE NOTES
|
||||
. The PDO::FETCH_SERIALIZE mode has been deprecated.
|
||||
RFC: https://wiki.php.net/rfc/phase_out_serializable
|
||||
|
||||
- SOAP:
|
||||
. The ssl_method option for the SoapClient constructor has been deprecated in
|
||||
favor of ssl stream context options. The direct equivalent would be
|
||||
crypto_method, but min_proto_version/max_proto_version are recommended
|
||||
instead.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_1
|
||||
|
||||
- Standard:
|
||||
. Calling key(), current(), next(), prev(), reset(), or end() on objects
|
||||
is deprecated. Instead cast the object to array first, or make use of
|
||||
|
||||
@@ -2127,6 +2127,9 @@ PHP_METHOD(SoapClient, __construct)
|
||||
if ((tmp = zend_hash_str_find(ht, "ssl_method", sizeof("ssl_method")-1)) != NULL &&
|
||||
Z_TYPE_P(tmp) == IS_LONG) {
|
||||
add_property_long(this_ptr, "_ssl_method", Z_LVAL_P(tmp));
|
||||
php_error_docref(NULL, E_DEPRECATED,
|
||||
"The \"ssl_method\" option is deprecated. "
|
||||
"Use \"ssl\" stream context options instead");
|
||||
}
|
||||
} else if (!wsdl) {
|
||||
php_error_docref(NULL, E_ERROR, "'location' and 'uri' options are required in nonWSDL mode");
|
||||
|
||||
16
ext/soap/tests/ssl_method_deprecation.phpt
Normal file
16
ext/soap/tests/ssl_method_deprecation.phpt
Normal file
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
ssl_method option is deprecated
|
||||
--EXTENSIONS--
|
||||
soap
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
new SoapClient(null, [
|
||||
'location' => 'foo',
|
||||
'uri' => 'bar',
|
||||
'ssl_method' => SOAP_SSL_METHOD_TLS,
|
||||
]);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: SoapClient::__construct(): The "ssl_method" option is deprecated. Use "ssl" stream context options instead in %s on line %d
|
||||
Reference in New Issue
Block a user