]> git.sesse.net Git - xml-template/commitdiff
Support includes in php5-swig.
authorsgunderson@bigfoot.com <>
Thu, 22 Sep 2011 23:29:54 +0000 (01:29 +0200)
committersgunderson@bigfoot.com <>
Thu, 22 Sep 2011 23:29:54 +0000 (01:29 +0200)
php5-swig/xml-template.swig

index 2feceba72843fada4f12226cfd7acf6ff36361cf..a2dd2d1926c6925149c9d41e05c327bab3a8684e 100644 (file)
@@ -58,6 +58,13 @@ Directive* convert_php_objects_to_directive(zval *obj)
                char *str = Z_STRVAL_P(obj);
                return new Replace(str);
        }
+       case IS_RESOURCE: {
+               xmlDocPtr *doc;
+               if (SWIG_ConvertPtr(obj, (void **)&doc, SWIGTYPE_p_xmlDocPtr, 0) < 0 || doc == NULL) {
+                       return NULL;
+               }
+               return new ReplaceInclude(xmlCopyDoc(*doc, 1));
+       }
        case IS_NULL:
                return NULL;
        default: