]> granicus.if.org Git - php/commitdiff
Added domxml_substitute_entities_default() function
authorJaroslaw Kolakowski <jarkol@php.net>
Mon, 21 Jan 2002 23:21:32 +0000 (23:21 +0000)
committerJaroslaw Kolakowski <jarkol@php.net>
Mon, 21 Jan 2002 23:21:32 +0000 (23:21 +0000)
ext/domxml/php_domxml.c
ext/domxml/php_domxml.h

index 7e6e9b977a2f2a8cd73f66c0e79876b5686e2e8d..903d4790638ebb121fce015774baabe84f5c125e 100644 (file)
@@ -188,6 +188,7 @@ static zend_function_entry domxml_functions[] = {
        PHP_FE(html_doc_file,                                                                                           NULL)
 #endif
        PHP_FE(xmltree,                                                                                                         NULL)
+       PHP_FE(domxml_substitute_entities_default,                                                                                                              NULL)
        PHP_FE(domxml_add_root,                                                                                         NULL)
        PHP_FE(domxml_dump_mem,                                                                                         NULL)
        PHP_FE(domxml_dump_mem_file,                                                                            NULL)
@@ -2840,6 +2841,28 @@ PHP_FUNCTION(html_doc_file)
 /* }}} */
 #endif  /* defined(LIBXML_HTML_ENABLED) */
 
+/* {{{ proto bool domxml_substitute_entities_default(bool enable)
+   Set and return the previous value for default entity support */
+PHP_FUNCTION(domxml_substitute_entities_default)
+{
+       zend_bool enable;
+       int old_val, new_val;
+
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &enable) == FAILURE) {
+               return;
+       }
+
+       new_val = (enable) ? 1 : 0;
+       old_val = xmlSubstituteEntitiesDefault(new_val);
+
+       if (old_val) {
+               RETURN_TRUE;
+       } else {
+               RETURN_FALSE;
+       }
+}
+/* }}} */
+
 /* {{{ proto bool domxml_node_text_concat(string content)
    Add string tocontent of a node */
 PHP_FUNCTION(domxml_node_text_concat)
index a14f0a8fd1f1d038ed255c0463174d518b78eb9c..b7f118f87e58677f23208eb12f7abcb45cc8bd41 100644 (file)
@@ -63,6 +63,7 @@ PHP_FUNCTION(html_doc_file);
 #endif
 PHP_FUNCTION(xmltree);
 PHP_FUNCTION(domxml_new_xmldoc);
+PHP_FUNCTION(domxml_substitute_entities_default);
 
 /* Class Document methods */
 PHP_FUNCTION(domxml_doc_doctype);