From 64d0fa5e8156508418ba95ceb4efdd77819c0eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Tue, 7 May 2024 09:17:38 +0200 Subject: [PATCH] Migrate SOAP URL resource to object Related to https://wiki.php.net/rfc/resource_to_object_conversion and https://github.com/php/php-tasks/issues/6 --- UPGRADING | 4 + ext/soap/php_http.c | 16 +- ext/soap/php_soap.h | 14 +- ext/soap/soap.c | 55 +- ext/soap/soap.stub.php | 1169 ++++++++++++++++++++------------------- ext/soap/soap_arginfo.h | 20 +- 6 files changed, 676 insertions(+), 602 deletions(-) diff --git a/UPGRADING b/UPGRADING index 70bf5c5743224..22f16c5655223 100644 --- a/UPGRADING +++ b/UPGRADING @@ -135,6 +135,10 @@ PHP 8.4 UPGRADE NOTES . Calling simplexml_import_dom() with a non-XML object now throws a TypeError instead of a ValueError. +- SOAP: + . SoapClient::$httpurl is now a Soap\Url object rather than a resource. + Checks using is_resource() (i.e. is_resource($client->httpurl)) should be + replaced with checks for null (i.e. $client->httpurl !== null). - SPL: . Out of bounds accesses in SplFixedArray now throw an exception of type OutOfBoundsException instead of RuntimeException. As OutOfBoundsException diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 241afb16e52d3..14d3919265d6a 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -484,8 +484,8 @@ int make_http_soap_request(zval *this_ptr, if (stream != NULL) { php_url *orig; tmp = Z_CLIENT_HTTPURL_P(this_ptr); - if (Z_TYPE_P(tmp) == IS_RESOURCE && - (orig = (php_url *) zend_fetch_resource_ex(tmp, "httpurl", le_url)) != NULL && + if (Z_TYPE_P(tmp) == IS_OBJECT && instanceof_function(Z_OBJCE_P(tmp), soap_url_class_entry) && + (orig = Z_SOAP_URL_P(tmp)->url) != NULL && ((use_proxy && !use_ssl) || (((use_ssl && orig->scheme != NULL && zend_string_equals_literal(orig->scheme, "https")) || (!use_ssl && orig->scheme == NULL) || @@ -536,9 +536,15 @@ int make_http_soap_request(zval *this_ptr, if (stream) { zval *cookies, *login, *password; - zend_resource *ret = zend_register_resource(phpurl, le_url); - ZVAL_RES(Z_CLIENT_HTTPURL_P(this_ptr), ret); - GC_ADDREF(ret); + + zval *url_zval = Z_CLIENT_HTTPURL_P(this_ptr); + if (Z_TYPE_P(url_zval) == IS_OBJECT) { + zval_ptr_dtor(url_zval); + } + + object_init_ex(url_zval, soap_url_class_entry); + soap_url_object *url_obj = Z_SOAP_URL_P(url_zval); + url_obj->url = phpurl; if (context && (tmp = php_stream_context_get_option(context, "http", "protocol_version")) != NULL && diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h index 33a071ed41819..83dda56e6ba76 100644 --- a/ext/soap/php_soap.h +++ b/ext/soap/php_soap.h @@ -40,8 +40,6 @@ # define stricmp strcasecmp #endif -extern int le_url; - typedef struct _encodeType encodeType, *encodeTypePtr; typedef struct _encode encode, *encodePtr; @@ -194,6 +192,7 @@ ZEND_TSRMLS_CACHE_EXTERN() extern zend_class_entry* soap_class_entry; extern zend_class_entry* soap_var_class_entry; +extern zend_class_entry* soap_url_class_entry; void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail); @@ -253,4 +252,15 @@ static zend_always_inline zval *php_soap_deref(zval *zv) { #define Z_CLIENT_LAST_REQUEST_HEADERS_P(zv) php_soap_deref(OBJ_PROP_NUM(Z_OBJ_P(zv), 34)) #define Z_CLIENT_LAST_RESPONSE_HEADERS_P(zv) php_soap_deref(OBJ_PROP_NUM(Z_OBJ_P(zv), 35)) +typedef struct soap_url_object { + php_url *url; + zend_object std; +} soap_url_object; + +static inline soap_url_object *soap_url_object_fetch(zend_object *obj) +{ + return (soap_url_object *) ((char *) obj - XtOffsetOf(soap_url_object, std)); +} + +#define Z_SOAP_URL_P(zv) soap_url_object_fetch(Z_OBJ_P(zv)) #endif diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 9064d1cbacef0..7584cc5756e01 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -30,7 +30,6 @@ static int le_sdl = 0; -int le_url = 0; static int le_typemap = 0; typedef struct _soapHeader { @@ -65,7 +64,6 @@ static xmlNodePtr serialize_parameter(sdlParamPtr param,zval *param_val,int inde static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName, int style, xmlNodePtr parent); static void delete_service(void *service); -static void delete_url(void *handle); static void delete_hashtable(void *hashtable); static void soap_error_handler(int error_num, zend_string *error_filename, const uint32_t error_lineno, zend_string *message); @@ -178,8 +176,10 @@ static zend_class_entry* soap_fault_class_entry; static zend_class_entry* soap_header_class_entry; static zend_class_entry* soap_param_class_entry; zend_class_entry* soap_var_class_entry; +zend_class_entry *soap_url_class_entry; static zend_object_handlers soap_server_object_handlers; +static zend_object_handlers soap_url_object_handlers; typedef struct { soapServicePtr service; @@ -206,6 +206,34 @@ static void soap_server_object_free(zend_object *obj) { zend_object_std_dtor(obj); } +static zend_object *soap_url_object_create(zend_class_entry *ce) +{ + soap_url_object *url_obj = zend_object_alloc(sizeof(soap_url_object), ce); + + zend_object_std_init(&url_obj->std, ce); + object_properties_init(&url_obj->std, ce); + + return &url_obj->std; +} + +static void soap_url_object_free(zend_object *obj) +{ + soap_url_object *url_obj = soap_url_object_fetch(obj); + + if (url_obj->url) { + php_url_free(url_obj->url); + url_obj->url = NULL; + } + + zend_object_std_dtor(&url_obj->std); +} + +static zend_function *soap_url_object_get_constructor(zend_object *object) +{ + zend_throw_error(NULL, "Cannot directly construct Soap\\Url"); + + return NULL; +} ZEND_DECLARE_MODULE_GLOBALS(soap) static void (*old_error_handler)(int, zend_string *, const uint32_t, zend_string *); @@ -395,11 +423,6 @@ static void delete_sdl_res(zend_resource *res) delete_sdl(res->ptr); } -static void delete_url_res(zend_resource *res) -{ - delete_url(res->ptr); -} - static void delete_hashtable_res(zend_resource *res) { delete_hashtable(res->ptr); @@ -436,9 +459,19 @@ PHP_MINIT_FUNCTION(soap) soap_header_class_entry = register_class_SoapHeader(); le_sdl = zend_register_list_destructors_ex(delete_sdl_res, NULL, "SOAP SDL", module_number); - le_url = zend_register_list_destructors_ex(delete_url_res, NULL, "SOAP URL", module_number); le_typemap = zend_register_list_destructors_ex(delete_hashtable_res, NULL, "SOAP table", module_number); + soap_url_class_entry = register_class_Soap_Url(); + soap_url_class_entry->create_object = soap_url_object_create; + soap_url_class_entry->default_object_handlers = &soap_url_object_handlers; + + memcpy(&soap_url_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); + soap_url_object_handlers.offset = XtOffsetOf(soap_url_object, std); + soap_url_object_handlers.free_obj = soap_url_object_free; + soap_url_object_handlers.get_constructor = soap_url_object_get_constructor; + soap_url_object_handlers.clone_obj = NULL; + soap_url_object_handlers.compare = zend_objects_not_comparable; + register_soap_symbols(module_number); old_error_handler = zend_error_cb; @@ -4355,12 +4388,6 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) /* {{{ */ } /* }}} */ -static void delete_url(void *handle) /* {{{ */ -{ - php_url_free((php_url*)handle); -} -/* }}} */ - static void delete_service(void *data) /* {{{ */ { soapServicePtr service = (soapServicePtr)data; diff --git a/ext/soap/soap.stub.php b/ext/soap/soap.stub.php index 99d752a723e03..c23b21c0f498b 100644 --- a/ext/soap/soap.stub.php +++ b/ext/soap/soap.stub.php @@ -2,603 +2,614 @@ /** @generate-class-entries */ -/** - * @var int - * @cvalue SOAP_1_1 - */ -const SOAP_1_1 = UNKNOWN; -/** - * @var int - * @cvalue SOAP_1_2 - */ -const SOAP_1_2 = UNKNOWN; -/** - * @var int - * @cvalue SOAP_PERSISTENCE_SESSION - */ -const SOAP_PERSISTENCE_SESSION = UNKNOWN; -/** - * @var int - * @cvalue SOAP_PERSISTENCE_REQUEST - */ -const SOAP_PERSISTENCE_REQUEST = UNKNOWN; -/** - * @var int - * @cvalue SOAP_FUNCTIONS_ALL - */ -const SOAP_FUNCTIONS_ALL = UNKNOWN; - -/** - * @var int - * @cvalue SOAP_ENCODED - */ -const SOAP_ENCODED = UNKNOWN; -/** - * @var int - * @cvalue SOAP_LITERAL - */ -const SOAP_LITERAL = UNKNOWN; - -/** - * @var int - * @cvalue SOAP_RPC - */ -const SOAP_RPC = UNKNOWN; -/** - * @var int - * @cvalue SOAP_DOCUMENT - */ -const SOAP_DOCUMENT = UNKNOWN; - -/** - * @var int - * @cvalue SOAP_ACTOR_NEXT - */ -const SOAP_ACTOR_NEXT = UNKNOWN; -/** - * @var int - * @cvalue SOAP_ACTOR_NONE - */ -const SOAP_ACTOR_NONE = UNKNOWN; -/** - * @var int - * @cvalue SOAP_ACTOR_UNLIMATERECEIVER - */ -const SOAP_ACTOR_UNLIMATERECEIVER = UNKNOWN; - -/** - * @var int - * @cvalue SOAP_COMPRESSION_ACCEPT - */ -const SOAP_COMPRESSION_ACCEPT = UNKNOWN; -/** - * @var int - * @cvalue SOAP_COMPRESSION_GZIP - */ -const SOAP_COMPRESSION_GZIP = UNKNOWN; -/** - * @var int - * @cvalue SOAP_COMPRESSION_DEFLATE - */ -const SOAP_COMPRESSION_DEFLATE = UNKNOWN; - -/** - * @var int - * @cvalue SOAP_AUTHENTICATION_BASIC - */ -const SOAP_AUTHENTICATION_BASIC = UNKNOWN; -/** - * @var int - * @cvalue SOAP_AUTHENTICATION_DIGEST - */ -const SOAP_AUTHENTICATION_DIGEST = UNKNOWN; - -/** - * @var int - * @cvalue UNKNOWN_TYPE - */ -const UNKNOWN_TYPE = UNKNOWN; - -/** - * @var int - * @cvalue XSD_STRING - */ -const XSD_STRING = UNKNOWN; -/** - * @var int - * @cvalue XSD_BOOLEAN - */ -const XSD_BOOLEAN = UNKNOWN; -/** - * @var int - * @cvalue XSD_DECIMAL - */ -const XSD_DECIMAL = UNKNOWN; -/** - * @var int - * @cvalue XSD_FLOAT - */ -const XSD_FLOAT = UNKNOWN; -/** - * @var int - * @cvalue XSD_DOUBLE - */ -const XSD_DOUBLE = UNKNOWN; -/** - * @var int - * @cvalue XSD_DURATION - */ -const XSD_DURATION = UNKNOWN; -/** - * @var int - * @cvalue XSD_DATETIME - */ -const XSD_DATETIME = UNKNOWN; -/** - * @var int - * @cvalue XSD_TIME - */ -const XSD_TIME = UNKNOWN; -/** - * @var int - * @cvalue XSD_DATE - */ -const XSD_DATE = UNKNOWN; -/** - * @var int - * @cvalue XSD_GYEARMONTH - */ -const XSD_GYEARMONTH = UNKNOWN; -/** - * @var int - * @cvalue XSD_GYEAR - */ -const XSD_GYEAR = UNKNOWN; -/** - * @var int - * @cvalue XSD_GMONTHDAY - */ -const XSD_GMONTHDAY = UNKNOWN; -/** - * @var int - * @cvalue XSD_GDAY - */ -const XSD_GDAY = UNKNOWN; -/** - * @var int - * @cvalue XSD_GMONTH - */ -const XSD_GMONTH = UNKNOWN; -/** - * @var int - * @cvalue XSD_HEXBINARY - */ -const XSD_HEXBINARY = UNKNOWN; -/** - * @var int - * @cvalue XSD_BASE64BINARY - */ -const XSD_BASE64BINARY = UNKNOWN; -/** - * @var int - * @cvalue XSD_ANYURI - */ -const XSD_ANYURI = UNKNOWN; -/** - * @var int - * @cvalue XSD_QNAME - */ -const XSD_QNAME = UNKNOWN; -/** - * @var int - * @cvalue XSD_NOTATION - */ -const XSD_NOTATION = UNKNOWN; - -/** - * @var int - * @cvalue XSD_NORMALIZEDSTRING - */ -const XSD_NORMALIZEDSTRING = UNKNOWN; -/** - * @var int - * @cvalue XSD_TOKEN - */ -const XSD_TOKEN = UNKNOWN; -/** - * @var int - * @cvalue XSD_LANGUAGE - */ -const XSD_LANGUAGE = UNKNOWN; -/** - * @var int - * @cvalue XSD_NMTOKEN - */ -const XSD_NMTOKEN = UNKNOWN; -/** - * @var int - * @cvalue XSD_NAME - */ -const XSD_NAME = UNKNOWN; -/** - * @var int - * @cvalue XSD_NCNAME - */ -const XSD_NCNAME = UNKNOWN; -/** - * @var int - * @cvalue XSD_ID - */ -const XSD_ID = UNKNOWN; -/** - * @var int - * @cvalue XSD_IDREF - */ -const XSD_IDREF = UNKNOWN; -/** - * @var int - * @cvalue XSD_IDREFS - */ -const XSD_IDREFS = UNKNOWN; -/** - * @var int - * @cvalue XSD_ENTITY - */ -const XSD_ENTITY = UNKNOWN; -/** - * @var int - * @cvalue XSD_ENTITIES - */ -const XSD_ENTITIES = UNKNOWN; -/** - * @var int - * @cvalue XSD_INTEGER - */ -const XSD_INTEGER = UNKNOWN; -/** - * @var int - * @cvalue XSD_NONPOSITIVEINTEGER - */ -const XSD_NONPOSITIVEINTEGER = UNKNOWN; -/** - * @var int - * @cvalue XSD_NEGATIVEINTEGER - */ -const XSD_NEGATIVEINTEGER = UNKNOWN; -/** - * @var int - * @cvalue XSD_LONG - */ -const XSD_LONG = UNKNOWN; -/** - * @var int - * @cvalue XSD_INT - */ -const XSD_INT = UNKNOWN; -/** - * @var int - * @cvalue XSD_SHORT - */ -const XSD_SHORT = UNKNOWN; -/** - * @var int - * @cvalue XSD_BYTE - */ -const XSD_BYTE = UNKNOWN; -/** - * @var int - * @cvalue XSD_NONNEGATIVEINTEGER - */ -const XSD_NONNEGATIVEINTEGER = UNKNOWN; -/** - * @var int - * @cvalue XSD_UNSIGNEDLONG - */ -const XSD_UNSIGNEDLONG = UNKNOWN; -/** - * @var int - * @cvalue XSD_UNSIGNEDINT - */ -const XSD_UNSIGNEDINT = UNKNOWN; -/** - * @var int - * @cvalue XSD_UNSIGNEDSHORT - */ -const XSD_UNSIGNEDSHORT = UNKNOWN; -/** - * @var int - * @cvalue XSD_UNSIGNEDBYTE - */ -const XSD_UNSIGNEDBYTE = UNKNOWN; -/** - * @var int - * @cvalue XSD_POSITIVEINTEGER - */ -const XSD_POSITIVEINTEGER = UNKNOWN; -/** - * @var int - * @cvalue XSD_NMTOKENS - */ -const XSD_NMTOKENS = UNKNOWN; -/** - * @var int - * @cvalue XSD_ANYTYPE - */ -const XSD_ANYTYPE = UNKNOWN; -/** - * @var int - * @cvalue XSD_ANYXML - */ -const XSD_ANYXML = UNKNOWN; - -/** - * @var int - * @cvalue APACHE_MAP - */ -const APACHE_MAP = UNKNOWN; - -/** - * @var int - * @cvalue SOAP_ENC_OBJECT - */ -const SOAP_ENC_OBJECT = UNKNOWN; -/** - * @var int - * @cvalue SOAP_ENC_ARRAY - */ -const SOAP_ENC_ARRAY = UNKNOWN; - -/** - * @var int - * @cvalue XSD_1999_TIMEINSTANT - */ -const XSD_1999_TIMEINSTANT = UNKNOWN; - -/** - * @var string - * @cvalue XSD_NAMESPACE - */ -const XSD_NAMESPACE = UNKNOWN; -/** - * @var string - * @cvalue XSD_1999_NAMESPACE - */ -const XSD_1999_NAMESPACE = UNKNOWN; - -/** - * @var int - * @cvalue SOAP_SINGLE_ELEMENT_ARRAYS - */ -const SOAP_SINGLE_ELEMENT_ARRAYS = UNKNOWN; -/** - * @var int - * @cvalue SOAP_WAIT_ONE_WAY_CALLS - */ -const SOAP_WAIT_ONE_WAY_CALLS = UNKNOWN; -/** - * @var int - * @cvalue SOAP_USE_XSI_ARRAY_TYPE - */ -const SOAP_USE_XSI_ARRAY_TYPE = UNKNOWN; - -/** - * @var int - * @cvalue WSDL_CACHE_NONE - */ -const WSDL_CACHE_NONE = UNKNOWN; -/** - * @var int - * @cvalue WSDL_CACHE_DISK - */ -const WSDL_CACHE_DISK = UNKNOWN; -/** - * @var int - * @cvalue WSDL_CACHE_MEMORY - */ -const WSDL_CACHE_MEMORY = UNKNOWN; -/** - * @var int - * @cvalue WSDL_CACHE_BOTH - */ -const WSDL_CACHE_BOTH = UNKNOWN; - -/* New SOAP SSL Method Constants */ - -/** - * @var int - * @cvalue SOAP_SSL_METHOD_TLS - */ -const SOAP_SSL_METHOD_TLS = UNKNOWN; -/** - * @var int - * @cvalue SOAP_SSL_METHOD_SSLv2 - */ -const SOAP_SSL_METHOD_SSLv2 = UNKNOWN; -/** - * @var int - * @cvalue SOAP_SSL_METHOD_SSLv3 - */ -const SOAP_SSL_METHOD_SSLv3 = UNKNOWN; -/** - * @var int - * @cvalue SOAP_SSL_METHOD_SSLv23 - */ -const SOAP_SSL_METHOD_SSLv23 = UNKNOWN; - -function use_soap_error_handler(bool $enable = true): bool {} - -function is_soap_fault(mixed $object): bool {} - -class SoapParam -{ - public string $param_name; - public mixed $param_data; - - public function __construct(mixed $data, string $name) {} +namespace Soap { + /** + * @strict-properties + * @not-serializable + */ + final class Url + { + } } -class SoapHeader -{ - public string $namespace; - public string $name; - public mixed $data = null; - public bool $mustUnderstand; - public string|int|null $actor; - - public function __construct(string $namespace, string $name, mixed $data = UNKNOWN, bool $mustUnderstand = false, string|int|null $actor = null) {} -} +namespace { + /** + * @var int + * @cvalue SOAP_1_1 + */ + const SOAP_1_1 = UNKNOWN; + /** + * @var int + * @cvalue SOAP_1_2 + */ + const SOAP_1_2 = UNKNOWN; + /** + * @var int + * @cvalue SOAP_PERSISTENCE_SESSION + */ + const SOAP_PERSISTENCE_SESSION = UNKNOWN; + /** + * @var int + * @cvalue SOAP_PERSISTENCE_REQUEST + */ + const SOAP_PERSISTENCE_REQUEST = UNKNOWN; + /** + * @var int + * @cvalue SOAP_FUNCTIONS_ALL + */ + const SOAP_FUNCTIONS_ALL = UNKNOWN; -class SoapFault extends Exception -{ - public string $faultstring; - public ?string $faultcode = null; - public ?string $faultcodens = null; - public ?string $faultactor = null; - public mixed $detail = null; - public ?string $_name = null; - public mixed $headerfault = null; + /** + * @var int + * @cvalue SOAP_ENCODED + */ + const SOAP_ENCODED = UNKNOWN; + /** + * @var int + * @cvalue SOAP_LITERAL + */ + const SOAP_LITERAL = UNKNOWN; - public function __construct(array|string|null $code, string $string, ?string $actor = null, mixed $details = null, ?string $name = null, mixed $headerFault = null) {} + /** + * @var int + * @cvalue SOAP_RPC + */ + const SOAP_RPC = UNKNOWN; + /** + * @var int + * @cvalue SOAP_DOCUMENT + */ + const SOAP_DOCUMENT = UNKNOWN; - public function __toString(): string {} -} + /** + * @var int + * @cvalue SOAP_ACTOR_NEXT + */ + const SOAP_ACTOR_NEXT = UNKNOWN; + /** + * @var int + * @cvalue SOAP_ACTOR_NONE + */ + const SOAP_ACTOR_NONE = UNKNOWN; + /** + * @var int + * @cvalue SOAP_ACTOR_UNLIMATERECEIVER + */ + const SOAP_ACTOR_UNLIMATERECEIVER = UNKNOWN; -class SoapVar -{ - public int $enc_type; - public mixed $enc_value = null; - public ?string $enc_stype = null; - public ?string $enc_ns = null; - public ?string $enc_name = null; - public ?string $enc_namens = null; + /** + * @var int + * @cvalue SOAP_COMPRESSION_ACCEPT + */ + const SOAP_COMPRESSION_ACCEPT = UNKNOWN; + /** + * @var int + * @cvalue SOAP_COMPRESSION_GZIP + */ + const SOAP_COMPRESSION_GZIP = UNKNOWN; + /** + * @var int + * @cvalue SOAP_COMPRESSION_DEFLATE + */ + const SOAP_COMPRESSION_DEFLATE = UNKNOWN; - public function __construct(mixed $data, ?int $encoding, ?string $typeName = null, ?string $typeNamespace = null, ?string $nodeName = null, ?string $nodeNamespace = null) {} -} + /** + * @var int + * @cvalue SOAP_AUTHENTICATION_BASIC + */ + const SOAP_AUTHENTICATION_BASIC = UNKNOWN; + /** + * @var int + * @cvalue SOAP_AUTHENTICATION_DIGEST + */ + const SOAP_AUTHENTICATION_DIGEST = UNKNOWN; -class SoapServer -{ - private ?SoapFault $__soap_fault = null; + /** + * @var int + * @cvalue UNKNOWN_TYPE + */ + const UNKNOWN_TYPE = UNKNOWN; - public function __construct(?string $wsdl, array $options = []) {} + /** + * @var int + * @cvalue XSD_STRING + */ + const XSD_STRING = UNKNOWN; + /** + * @var int + * @cvalue XSD_BOOLEAN + */ + const XSD_BOOLEAN = UNKNOWN; + /** + * @var int + * @cvalue XSD_DECIMAL + */ + const XSD_DECIMAL = UNKNOWN; + /** + * @var int + * @cvalue XSD_FLOAT + */ + const XSD_FLOAT = UNKNOWN; + /** + * @var int + * @cvalue XSD_DOUBLE + */ + const XSD_DOUBLE = UNKNOWN; + /** + * @var int + * @cvalue XSD_DURATION + */ + const XSD_DURATION = UNKNOWN; + /** + * @var int + * @cvalue XSD_DATETIME + */ + const XSD_DATETIME = UNKNOWN; + /** + * @var int + * @cvalue XSD_TIME + */ + const XSD_TIME = UNKNOWN; + /** + * @var int + * @cvalue XSD_DATE + */ + const XSD_DATE = UNKNOWN; + /** + * @var int + * @cvalue XSD_GYEARMONTH + */ + const XSD_GYEARMONTH = UNKNOWN; + /** + * @var int + * @cvalue XSD_GYEAR + */ + const XSD_GYEAR = UNKNOWN; + /** + * @var int + * @cvalue XSD_GMONTHDAY + */ + const XSD_GMONTHDAY = UNKNOWN; + /** + * @var int + * @cvalue XSD_GDAY + */ + const XSD_GDAY = UNKNOWN; + /** + * @var int + * @cvalue XSD_GMONTH + */ + const XSD_GMONTH = UNKNOWN; + /** + * @var int + * @cvalue XSD_HEXBINARY + */ + const XSD_HEXBINARY = UNKNOWN; + /** + * @var int + * @cvalue XSD_BASE64BINARY + */ + const XSD_BASE64BINARY = UNKNOWN; + /** + * @var int + * @cvalue XSD_ANYURI + */ + const XSD_ANYURI = UNKNOWN; + /** + * @var int + * @cvalue XSD_QNAME + */ + const XSD_QNAME = UNKNOWN; + /** + * @var int + * @cvalue XSD_NOTATION + */ + const XSD_NOTATION = UNKNOWN; - /** @tentative-return-type */ - public function fault(string $code, string $string, string $actor = "", mixed $details = null, string $name = ""): void {} + /** + * @var int + * @cvalue XSD_NORMALIZEDSTRING + */ + const XSD_NORMALIZEDSTRING = UNKNOWN; + /** + * @var int + * @cvalue XSD_TOKEN + */ + const XSD_TOKEN = UNKNOWN; + /** + * @var int + * @cvalue XSD_LANGUAGE + */ + const XSD_LANGUAGE = UNKNOWN; + /** + * @var int + * @cvalue XSD_NMTOKEN + */ + const XSD_NMTOKEN = UNKNOWN; + /** + * @var int + * @cvalue XSD_NAME + */ + const XSD_NAME = UNKNOWN; + /** + * @var int + * @cvalue XSD_NCNAME + */ + const XSD_NCNAME = UNKNOWN; + /** + * @var int + * @cvalue XSD_ID + */ + const XSD_ID = UNKNOWN; + /** + * @var int + * @cvalue XSD_IDREF + */ + const XSD_IDREF = UNKNOWN; + /** + * @var int + * @cvalue XSD_IDREFS + */ + const XSD_IDREFS = UNKNOWN; + /** + * @var int + * @cvalue XSD_ENTITY + */ + const XSD_ENTITY = UNKNOWN; + /** + * @var int + * @cvalue XSD_ENTITIES + */ + const XSD_ENTITIES = UNKNOWN; + /** + * @var int + * @cvalue XSD_INTEGER + */ + const XSD_INTEGER = UNKNOWN; + /** + * @var int + * @cvalue XSD_NONPOSITIVEINTEGER + */ + const XSD_NONPOSITIVEINTEGER = UNKNOWN; + /** + * @var int + * @cvalue XSD_NEGATIVEINTEGER + */ + const XSD_NEGATIVEINTEGER = UNKNOWN; + /** + * @var int + * @cvalue XSD_LONG + */ + const XSD_LONG = UNKNOWN; + /** + * @var int + * @cvalue XSD_INT + */ + const XSD_INT = UNKNOWN; + /** + * @var int + * @cvalue XSD_SHORT + */ + const XSD_SHORT = UNKNOWN; + /** + * @var int + * @cvalue XSD_BYTE + */ + const XSD_BYTE = UNKNOWN; + /** + * @var int + * @cvalue XSD_NONNEGATIVEINTEGER + */ + const XSD_NONNEGATIVEINTEGER = UNKNOWN; + /** + * @var int + * @cvalue XSD_UNSIGNEDLONG + */ + const XSD_UNSIGNEDLONG = UNKNOWN; + /** + * @var int + * @cvalue XSD_UNSIGNEDINT + */ + const XSD_UNSIGNEDINT = UNKNOWN; + /** + * @var int + * @cvalue XSD_UNSIGNEDSHORT + */ + const XSD_UNSIGNEDSHORT = UNKNOWN; + /** + * @var int + * @cvalue XSD_UNSIGNEDBYTE + */ + const XSD_UNSIGNEDBYTE = UNKNOWN; + /** + * @var int + * @cvalue XSD_POSITIVEINTEGER + */ + const XSD_POSITIVEINTEGER = UNKNOWN; + /** + * @var int + * @cvalue XSD_NMTOKENS + */ + const XSD_NMTOKENS = UNKNOWN; + /** + * @var int + * @cvalue XSD_ANYTYPE + */ + const XSD_ANYTYPE = UNKNOWN; + /** + * @var int + * @cvalue XSD_ANYXML + */ + const XSD_ANYXML = UNKNOWN; - /** @tentative-return-type */ - public function addSoapHeader(SoapHeader $header): void {} + /** + * @var int + * @cvalue APACHE_MAP + */ + const APACHE_MAP = UNKNOWN; - /** @tentative-return-type */ - public function setPersistence(int $mode): void {} + /** + * @var int + * @cvalue SOAP_ENC_OBJECT + */ + const SOAP_ENC_OBJECT = UNKNOWN; + /** + * @var int + * @cvalue SOAP_ENC_ARRAY + */ + const SOAP_ENC_ARRAY = UNKNOWN; - /** @tentative-return-type */ - public function setClass(string $class, mixed ...$args): void {} + /** + * @var int + * @cvalue XSD_1999_TIMEINSTANT + */ + const XSD_1999_TIMEINSTANT = UNKNOWN; - /** @tentative-return-type */ - public function setObject(object $object): void {} + /** + * @var string + * @cvalue XSD_NAMESPACE + */ + const XSD_NAMESPACE = UNKNOWN; + /** + * @var string + * @cvalue XSD_1999_NAMESPACE + */ + const XSD_1999_NAMESPACE = UNKNOWN; - /** @tentative-return-type */ - public function getFunctions(): array {} + /** + * @var int + * @cvalue SOAP_SINGLE_ELEMENT_ARRAYS + */ + const SOAP_SINGLE_ELEMENT_ARRAYS = UNKNOWN; + /** + * @var int + * @cvalue SOAP_WAIT_ONE_WAY_CALLS + */ + const SOAP_WAIT_ONE_WAY_CALLS = UNKNOWN; + /** + * @var int + * @cvalue SOAP_USE_XSI_ARRAY_TYPE + */ + const SOAP_USE_XSI_ARRAY_TYPE = UNKNOWN; /** - * @param array|string|int $functions - * @tentative-return-type + * @var int + * @cvalue WSDL_CACHE_NONE + */ + const WSDL_CACHE_NONE = UNKNOWN; + /** + * @var int + * @cvalue WSDL_CACHE_DISK + */ + const WSDL_CACHE_DISK = UNKNOWN; + /** + * @var int + * @cvalue WSDL_CACHE_MEMORY + */ + const WSDL_CACHE_MEMORY = UNKNOWN; + /** + * @var int + * @cvalue WSDL_CACHE_BOTH */ - public function addFunction($functions): void {} + const WSDL_CACHE_BOTH = UNKNOWN; - /** @tentative-return-type */ - public function handle(?string $request = null): void {} -} + /* New SOAP SSL Method Constants */ -class SoapClient -{ - private ?string $uri = null; - private ?int $style = null; - private ?int $use = null; - private ?string $location = null; - private bool $trace = false; - private ?int $compression = null; - /** @var resource|null */ - private $sdl = null; - /** @var resource|null */ - private $typemap = null; - /** @var resource|null */ - private $httpsocket = null; - /** @var resource|null */ - private $httpurl = null; - - private ?string $_login = null; - private ?string $_password = null; - private bool $_use_digest = false; - private ?string $_digest = null; - private ?string $_proxy_host = null; - private ?int $_proxy_port = null; - private ?string $_proxy_login = null; - private ?string $_proxy_password = null; - private bool $_exceptions = true; - private ?string $_encoding = null; - private ?array $_classmap = null; - private ?int $_features = null; - private int $_connection_timeout = 0; - /** @var resource|null */ - private $_stream_context = null; - private ?string $_user_agent = null; - private bool $_keep_alive = true; - private ?int $_ssl_method = null; - private int $_soap_version; - private ?int $_use_proxy = null; - private array $_cookies = []; - private ?array $__default_headers = null; - private ?SoapFault $__soap_fault = null; - private ?string $__last_request = null; - private ?string $__last_response = null; - private ?string $__last_request_headers = null; - private ?string $__last_response_headers = null; - - public function __construct(?string $wsdl, array $options = []) {} - - /** @tentative-return-type */ - public function __call(string $name, array $args): mixed {} - - /** - * @param SoapHeader|array|null $inputHeaders - * @param array $outputHeaders - * @tentative-return-type - */ - public function __soapCall(string $name, array $args, ?array $options = null, $inputHeaders = null, &$outputHeaders = null): mixed {} - - /** @tentative-return-type */ - public function __getFunctions(): ?array {} - - /** @tentative-return-type */ - public function __getTypes(): ?array {} - - /** @tentative-return-type */ - public function __getLastRequest(): ?string {} - - /** @tentative-return-type */ - public function __getLastResponse(): ?string {} - - /** @tentative-return-type */ - public function __getLastRequestHeaders(): ?string {} - - /** @tentative-return-type */ - public function __getLastResponseHeaders(): ?string {} - - /** @tentative-return-type */ - public function __doRequest(string $request, string $location, string $action, int $version, bool $oneWay = false): ?string {} - - /** @tentative-return-type */ - public function __setCookie(string $name, ?string $value = null): void {} - - /** @tentative-return-type */ - public function __getCookies(): array {} - - /** - * @param SoapHeader|array|null $headers - * @tentative-return-type - */ - public function __setSoapHeaders($headers = null): bool {} - - /** @tentative-return-type */ - public function __setLocation(?string $location = null): ?string {} + /** + * @var int + * @cvalue SOAP_SSL_METHOD_TLS + */ + const SOAP_SSL_METHOD_TLS = UNKNOWN; + /** + * @var int + * @cvalue SOAP_SSL_METHOD_SSLv2 + */ + const SOAP_SSL_METHOD_SSLv2 = UNKNOWN; + /** + * @var int + * @cvalue SOAP_SSL_METHOD_SSLv3 + */ + const SOAP_SSL_METHOD_SSLv3 = UNKNOWN; + /** + * @var int + * @cvalue SOAP_SSL_METHOD_SSLv23 + */ + const SOAP_SSL_METHOD_SSLv23 = UNKNOWN; + + function use_soap_error_handler(bool $enable = true): bool {} + + function is_soap_fault(mixed $object): bool {} + + class SoapParam + { + public string $param_name; + public mixed $param_data; + + public function __construct(mixed $data, string $name) {} + } + + class SoapHeader + { + public string $namespace; + public string $name; + public mixed $data = null; + public bool $mustUnderstand; + public string|int|null $actor; + + public function __construct(string $namespace, string $name, mixed $data = UNKNOWN, bool $mustUnderstand = false, string|int|null $actor = null) {} + } + + class SoapFault extends Exception + { + public string $faultstring; + public ?string $faultcode = null; + public ?string $faultcodens = null; + public ?string $faultactor = null; + public mixed $detail = null; + public ?string $_name = null; + public mixed $headerfault = null; + + public function __construct(array|string|null $code, string $string, ?string $actor = null, mixed $details = null, ?string $name = null, mixed $headerFault = null) {} + + public function __toString(): string {} + } + + class SoapVar + { + public int $enc_type; + public mixed $enc_value = null; + public ?string $enc_stype = null; + public ?string $enc_ns = null; + public ?string $enc_name = null; + public ?string $enc_namens = null; + + public function __construct(mixed $data, ?int $encoding, ?string $typeName = null, ?string $typeNamespace = null, ?string $nodeName = null, ?string $nodeNamespace = null) {} + } + + class SoapServer + { + private ?SoapFault $__soap_fault = null; + + public function __construct(?string $wsdl, array $options = []) {} + + /** @tentative-return-type */ + public function fault(string $code, string $string, string $actor = "", mixed $details = null, string $name = ""): void {} + + /** @tentative-return-type */ + public function addSoapHeader(SoapHeader $header): void {} + + /** @tentative-return-type */ + public function setPersistence(int $mode): void {} + + /** @tentative-return-type */ + public function setClass(string $class, mixed ...$args): void {} + + /** @tentative-return-type */ + public function setObject(object $object): void {} + + /** @tentative-return-type */ + public function getFunctions(): array {} + + /** + * @param array|string|int $functions + * @tentative-return-type + */ + public function addFunction($functions): void {} + + /** @tentative-return-type */ + public function handle(?string $request = null): void {} + } + + class SoapClient + { + private ?string $uri = null; + private ?int $style = null; + private ?int $use = null; + private ?string $location = null; + private bool $trace = false; + private ?int $compression = null; + /** @var resource|null */ + private $sdl = null; + /** @var resource|null */ + private $typemap = null; + /** @var resource|null */ + private $httpsocket = null; + private ?Soap\Url $httpurl = null; + + private ?string $_login = null; + private ?string $_password = null; + private bool $_use_digest = false; + private ?string $_digest = null; + private ?string $_proxy_host = null; + private ?int $_proxy_port = null; + private ?string $_proxy_login = null; + private ?string $_proxy_password = null; + private bool $_exceptions = true; + private ?string $_encoding = null; + private ?array $_classmap = null; + private ?int $_features = null; + private int $_connection_timeout = 0; + /** @var resource|null */ + private $_stream_context = null; + private ?string $_user_agent = null; + private bool $_keep_alive = true; + private ?int $_ssl_method = null; + private int $_soap_version; + private ?int $_use_proxy = null; + private array $_cookies = []; + private ?array $__default_headers = null; + private ?SoapFault $__soap_fault = null; + private ?string $__last_request = null; + private ?string $__last_response = null; + private ?string $__last_request_headers = null; + private ?string $__last_response_headers = null; + + public function __construct(?string $wsdl, array $options = []) {} + + /** @tentative-return-type */ + public function __call(string $name, array $args): mixed {} + + /** + * @param SoapHeader|array|null $inputHeaders + * @param array $outputHeaders + * @tentative-return-type + */ + public function __soapCall(string $name, array $args, ?array $options = null, $inputHeaders = null, &$outputHeaders = null): mixed {} + + /** @tentative-return-type */ + public function __getFunctions(): ?array {} + + /** @tentative-return-type */ + public function __getTypes(): ?array {} + + /** @tentative-return-type */ + public function __getLastRequest(): ?string {} + + /** @tentative-return-type */ + public function __getLastResponse(): ?string {} + + /** @tentative-return-type */ + public function __getLastRequestHeaders(): ?string {} + + /** @tentative-return-type */ + public function __getLastResponseHeaders(): ?string {} + + /** @tentative-return-type */ + public function __doRequest(string $request, string $location, string $action, int $version, bool $oneWay = false): ?string {} + + /** @tentative-return-type */ + public function __setCookie(string $name, ?string $value = null): void {} + + /** @tentative-return-type */ + public function __getCookies(): array {} + + /** + * @param SoapHeader|array|null $headers + * @tentative-return-type + */ + public function __setSoapHeaders($headers = null): bool {} + + /** @tentative-return-type */ + public function __setLocation(?string $location = null): ?string {} + } } diff --git a/ext/soap/soap_arginfo.h b/ext/soap/soap_arginfo.h index e4611093842a0..c4df10ab8aa7c 100644 --- a/ext/soap/soap_arginfo.h +++ b/ext/soap/soap_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4dfc98696d4bc5e36610bdf03de906dbae049cf3 */ + * Stub hash: 038c8f9ba355fba63e661148b48cdf0299b922f6 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_use_soap_error_handler, 0, 0, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 0, "true") @@ -173,6 +173,10 @@ static const zend_function_entry ext_functions[] = { ZEND_FE_END }; +static const zend_function_entry class_Soap_Url_methods[] = { + ZEND_FE_END +}; + static const zend_function_entry class_SoapParam_methods[] = { ZEND_ME(SoapParam, __construct, arginfo_class_SoapParam___construct, ZEND_ACC_PUBLIC) ZEND_FE_END @@ -310,6 +314,17 @@ static void register_soap_symbols(int module_number) REGISTER_LONG_CONSTANT("SOAP_SSL_METHOD_SSLv23", SOAP_SSL_METHOD_SSLv23, CONST_PERSISTENT); } +static zend_class_entry *register_class_Soap_Url(void) +{ + zend_class_entry ce, *class_entry; + + INIT_NS_CLASS_ENTRY(ce, "Soap", "Url", class_Soap_Url_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; + + return class_entry; +} + static zend_class_entry *register_class_SoapParam(void) { zend_class_entry ce, *class_entry; @@ -551,7 +566,8 @@ static zend_class_entry *register_class_SoapClient(void) zval property_httpurl_default_value; ZVAL_NULL(&property_httpurl_default_value); zend_string *property_httpurl_name = zend_string_init("httpurl", sizeof("httpurl") - 1, 1); - zend_declare_typed_property(class_entry, property_httpurl_name, &property_httpurl_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_NONE(0)); + zend_string *property_httpurl_class_Soap_Url = zend_string_init("Soap\\\125rl", sizeof("Soap\\\125rl")-1, 1); + zend_declare_typed_property(class_entry, property_httpurl_name, &property_httpurl_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_httpurl_class_Soap_Url, 0, MAY_BE_NULL)); zend_string_release(property_httpurl_name); zval property__login_default_value;