php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch soap-gettypes-enumeration for SOAP related Bug #55503

Patch version 2011-08-25 04:07 UTC

Return to Bug #55503 | Download this patch
Patch Revisions:

Developer: datibbaw

Index: ext/soap/soap.c
===================================================================
--- ext/soap/soap.c	(revision 315460)
+++ ext/soap/soap.c	(working copy)
@@ -4609,6 +4609,25 @@
 				smart_str_appendl(buf, "anyType ", sizeof("anyType ")-1);
 			}
 			smart_str_appendl(buf, type->name, strlen(type->name));
+			if (type->restrictions && type->restrictions->enumeration) {
+				HashTable *enumeration = type->restrictions->enumeration;
+				sdlRestrictionCharPtr *item_type;
+				int first = 1;
+
+				smart_str_appendl(buf, " {", 2);
+
+				zend_hash_internal_pointer_reset_ex(enumeration, &pos);
+				while (zend_hash_get_current_data_ex(enumeration, (void**)&item_type, &pos) != FAILURE) {
+					if (!first) {
+						smart_str_appendc(buf, ',');
+					} else {
+						first = 0;
+					}
+					smart_str_appendl(buf, (*item_type)->value, strlen((*item_type)->value));
+					zend_hash_move_forward_ex(enumeration, &pos);
+				}
+				smart_str_appendc(buf, '}');
+			}
 			break;
 		case XSD_TYPEKIND_LIST:
 			smart_str_appendl(buf, "list ", 5);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 17:01:29 2024 UTC