]> git.sesse.net Git - xml-template/commitdiff
Implement cloning in php5-swig.
authorsgunderson@bigfoot.com <>
Thu, 22 Sep 2011 21:05:49 +0000 (23:05 +0200)
committersgunderson@bigfoot.com <>
Thu, 22 Sep 2011 21:05:49 +0000 (23:05 +0200)
php5-swig/xml-template.swig

index d395ac20a72cc097ed7335b8dde68b7f6af1776a..fa9e7aa81d4bf0fbb6ee4b358c885549657025f7 100644 (file)
@@ -44,7 +44,13 @@ Directive* convert_php_objects_to_directive(zval *obj)
                        }
                        return new Substitute(my_map);
                } else {
-                       printf("ARRAY\n");
+                       std::vector<Directive *> 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;
        }