X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=php5-swig%2Fxml-template.swig;h=8a915ff4b8a7922459c813aaf2ff59fffb92982c;hb=351f3f4798d8b51c461489c2e716f7ba7ed855d1;hp=d395ac20a72cc097ed7335b8dde68b7f6af1776a;hpb=b6bae3e8cf33edf6bbedcf6d3266e581d06507af;p=xml-template diff --git a/php5-swig/xml-template.swig b/php5-swig/xml-template.swig index d395ac2..8a915ff 100644 --- a/php5-swig/xml-template.swig +++ b/php5-swig/xml-template.swig @@ -44,7 +44,13 @@ Directive* convert_php_objects_to_directive(zval *obj) } return new Substitute(my_map); } else { - printf("ARRAY\n"); + std::vector subdirectives; + for (unsigned i = 0; i < ht->nNumOfElements; ++i) { + zval **data; + zend_hash_index_find(ht, i, (void **)&data); + subdirectives.push_back(convert_php_objects_to_directive(*data)); + } + return new Clone(subdirectives); } break; } @@ -52,6 +58,8 @@ Directive* convert_php_objects_to_directive(zval *obj) char *str = Z_STRVAL_P(obj); return new Replace(str); } + case IS_NULL: + return NULL; default: printf("WARNING: Unknown type %d!\n", Z_TYPE_P(obj)); break;