From: sgunderson@bigfoot.com <> Date: Thu, 22 Sep 2011 21:05:49 +0000 (+0200) Subject: Implement cloning in php5-swig. X-Git-Url: https://git.sesse.net/?p=xml-template;a=commitdiff_plain;h=015976d7d24ac1ae6deb474b9d70e5703f54f449 Implement cloning in php5-swig. --- diff --git a/php5-swig/xml-template.swig b/php5-swig/xml-template.swig index d395ac2..fa9e7aa 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; }