diff options
author | Jaroslaw Kolakowski <jarkol@php.net> | 2002-01-21 23:21:32 +0000 |
---|---|---|
committer | Jaroslaw Kolakowski <jarkol@php.net> | 2002-01-21 23:21:32 +0000 |
commit | b7f0e6bd1ceaa09b9c837a17be3811ac5297621f (patch) | |
tree | 1459f3a500545ee1f9a32fed88aebd7f85499344 /ext/domxml | |
parent | 5f153ca92912e2565b410f5e285a66fe2cfeeade (diff) | |
download | php-git-b7f0e6bd1ceaa09b9c837a17be3811ac5297621f.tar.gz |
Added domxml_substitute_entities_default() function
Diffstat (limited to 'ext/domxml')
-rw-r--r-- | ext/domxml/php_domxml.c | 23 | ||||
-rw-r--r-- | ext/domxml/php_domxml.h | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 7e6e9b977a..903d479063 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -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) diff --git a/ext/domxml/php_domxml.h b/ext/domxml/php_domxml.h index a14f0a8fd1..b7f118f87e 100644 --- a/ext/domxml/php_domxml.h +++ b/ext/domxml/php_domxml.h @@ -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); |