Diff for /embedaddon/php/ext/soap/php_schema.c between versions 1.1.1.3 and 1.1.1.4

version 1.1.1.3, 2013/07/22 01:32:01 version 1.1.1.4, 2013/10/14 08:02:30
Line 1081  static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xm Line 1081  static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xm
                         nsptr = xmlSearchNs(groupType->doc, groupType, BAD_CAST(ns));                          nsptr = xmlSearchNs(groupType->doc, groupType, BAD_CAST(ns));
                         if (nsptr != NULL) {                          if (nsptr != NULL) {
                                 smart_str_appends(&key, (char*)nsptr->href);                                  smart_str_appends(&key, (char*)nsptr->href);
                           } else {
                                   xmlAttrPtr ns = get_attribute(groupType->properties, "targetNamespace");
                                   if (ns == NULL) {
                                           ns = tns;
                                   }
                                   if (ns) {
                                           smart_str_appends(&key, (char*)ns->children->content);
                                   }
                         }                          }
                         smart_str_appendc(&key, ':');                          smart_str_appendc(&key, ':');
                         smart_str_appends(&key, type);                          smart_str_appends(&key, type);
Line 1509  static int schema_element(sdlPtr sdl, xmlAttrPtr tns,  Line 1517  static int schema_element(sdlPtr sdl, xmlAttrPtr tns, 
                         if (nsptr != NULL) {                          if (nsptr != NULL) {
                                 smart_str_appends(&nscat, (char*)nsptr->href);                                  smart_str_appends(&nscat, (char*)nsptr->href);
                                 newType->namens = estrdup((char*)nsptr->href);                                  newType->namens = estrdup((char*)nsptr->href);
                           } else {
                                   xmlAttrPtr ns = get_attribute(attrs, "targetNamespace");
                                   if (ns == NULL) {
                                           ns = tns;
                                   }
                                   if (ns) {
                                           smart_str_appends(&nscat, (char*)ns->children->content);
                                   }
                         }                           } 
                         smart_str_appendc(&nscat, ':');                          smart_str_appendc(&nscat, ':');
                         smart_str_appends(&nscat, type);                          smart_str_appends(&nscat, type);
Line 1735  static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns Line 1751  static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns
                         if (nsptr != NULL) {                          if (nsptr != NULL) {
                                 smart_str_appends(&key, (char*)nsptr->href);                                  smart_str_appends(&key, (char*)nsptr->href);
                                 newAttr->namens = estrdup((char*)nsptr->href);                                  newAttr->namens = estrdup((char*)nsptr->href);
                           } else {
                                   xmlAttrPtr ns = get_attribute(attrType->properties, "targetNamespace");
                                   if (ns == NULL) {
                                           ns = tns;
                                   }
                                   if (ns) {
                                           smart_str_appends(&key, (char*)ns->children->content);
                                   }
                         }                          }
                         smart_str_appendc(&key, ':');                          smart_str_appendc(&key, ':');
                         smart_str_appends(&key, attr_name);                          smart_str_appends(&key, attr_name);
Line 2036  static void copy_extra_attribute(void *attribute) Line 2060  static void copy_extra_attribute(void *attribute)
         }          }
 }  }
   
   static void* schema_find_by_ref(HashTable *ht, char *ref)
   {
           void **tmp;
   
           if (zend_hash_find(ht, ref, strlen(ref)+1, (void**)&tmp) == SUCCESS) {
                   return tmp;
           } else {
                   ref = strrchr(ref, ':');
                   if (ref) {
                           if (zend_hash_find(ht, ref, strlen(ref)+1, (void**)&tmp) == SUCCESS) {
                                   return tmp;
                           }
                   }
           }
           return NULL;
   }
   
 static void schema_attribute_fixup(sdlCtx *ctx, sdlAttributePtr attr)  static void schema_attribute_fixup(sdlCtx *ctx, sdlAttributePtr attr)
 {  {
         sdlAttributePtr *tmp;          sdlAttributePtr *tmp;
   
         if (attr->ref != NULL) {          if (attr->ref != NULL) {
                 if (ctx->attributes != NULL) {                  if (ctx->attributes != NULL) {
                        if (zend_hash_find(ctx->attributes, attr->ref, strlen(attr->ref)+1, (void**)&tmp) == SUCCESS) {                        tmp = (sdlAttributePtr*)schema_find_by_ref(ctx->attributes, attr->ref);
                         if (tmp) {
                                 schema_attribute_fixup(ctx, *tmp);                                  schema_attribute_fixup(ctx, *tmp);
                                 if ((*tmp)->name != NULL && attr->name == NULL) {                                  if ((*tmp)->name != NULL && attr->name == NULL) {
                                         attr->name = estrdup((*tmp)->name);                                          attr->name = estrdup((*tmp)->name);
Line 2092  static void schema_attributegroup_fixup(sdlCtx *ctx, s Line 2134  static void schema_attributegroup_fixup(sdlCtx *ctx, s
   
         if (attr->ref != NULL) {          if (attr->ref != NULL) {
                 if (ctx->attributeGroups != NULL) {                  if (ctx->attributeGroups != NULL) {
                        if (zend_hash_find(ctx->attributeGroups, attr->ref, strlen(attr->ref)+1, (void**)&tmp) == SUCCESS) {                        tmp = (sdlTypePtr*)schema_find_by_ref(ctx->attributeGroups, attr->ref);
                         if (tmp) {
                                 if ((*tmp)->attributes) {                                  if ((*tmp)->attributes) {
                                         zend_hash_internal_pointer_reset((*tmp)->attributes);                                          zend_hash_internal_pointer_reset((*tmp)->attributes);
                                         while (zend_hash_get_current_data((*tmp)->attributes,(void**)&tmp_attr) == SUCCESS) {                                          while (zend_hash_get_current_data((*tmp)->attributes,(void**)&tmp_attr) == SUCCESS) {
Line 2149  static void schema_content_model_fixup(sdlCtx *ctx, sd Line 2192  static void schema_content_model_fixup(sdlCtx *ctx, sd
                                 model->kind = XSD_CONTENT_GROUP;                                  model->kind = XSD_CONTENT_GROUP;
                                 model->u.group = (*tmp);                                  model->u.group = (*tmp);
                         } else {                          } else {
                                soap_error0(E_ERROR, "Parsing Schema: unresolved group 'ref' attribute");                                soap_error1(E_ERROR, "Parsing Schema: unresolved group 'ref' attribute '%s'", model->u.group_ref);
                         }                          }
                         break;                          break;
                 }                  }
Line 2193  static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr  Line 2236  static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr 
   
         if (type->ref != NULL) {          if (type->ref != NULL) {
                 if (ctx->sdl->elements != NULL) {                  if (ctx->sdl->elements != NULL) {
                        if (zend_hash_find(ctx->sdl->elements, type->ref, strlen(type->ref)+1, (void**)&tmp) == SUCCESS) {                        tmp = (sdlTypePtr*)schema_find_by_ref(ctx->sdl->elements, type->ref);
                         if (tmp) {
                                 type->kind = (*tmp)->kind;                                  type->kind = (*tmp)->kind;
                                 type->encode = (*tmp)->encode;                                  type->encode = (*tmp)->encode;
                                 if ((*tmp)->nillable) {                                  if ((*tmp)->nillable) {
Line 2209  static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr  Line 2253  static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr 
                         } else if (strcmp(type->ref, SCHEMA_NAMESPACE ":schema") == 0) {                          } else if (strcmp(type->ref, SCHEMA_NAMESPACE ":schema") == 0) {
                                 type->encode = get_conversion(XSD_ANYXML);                                  type->encode = get_conversion(XSD_ANYXML);
                         } else {                          } else {
                                soap_error0(E_ERROR, "Parsing Schema: unresolved element 'ref' attribute");                                soap_error1(E_ERROR, "Parsing Schema: unresolved element 'ref' attribute '%s'", type->ref);
                         }                          }
                 }                  }
                 efree(type->ref);                  efree(type->ref);

Removed from v.1.1.1.3  
changed lines
  Added in v.1.1.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>