From 1a93bcbfd2f41a97754e3e53e7b99fd6941862d7 Mon Sep 17 00:00:00 2001 From: cvs2git Date: Tue, 29 Oct 2002 20:50:19 +0000 Subject: [PATCH] This commit was manufactured by cvs2git to create branch 'RA-branch'. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Sprout from master 2002-10-29 20:50:19 UTC Arkadiusz Miśkiewicz '- added identification of mail source patch (NOTE: this part is very important' Delete: php-4.1.2-dom-xslt-patch php-ZVAL.patch php-ac250.patch php-am_ac_lt.patch php-apache2.patch php-domxml_node.patch php-image_c.patch php-imap.patch php-libxml2.patch php-mailsecurity2.patch php-oracle9.patch php-pdflib4.0.2.patch php-pearinstall.patch php-register_shutdown_function.patch php-xml_fix --- php-4.1.2-dom-xslt-patch | 1802 -------------------------- php-ZVAL.patch | 14 - php-ac250.patch | 248 ---- php-am_ac_lt.patch | 33 - php-apache2.patch | 310 ----- php-domxml_node.patch | 10 - php-image_c.patch | 27 - php-imap.patch | 30 - php-libxml2.patch | 35 - php-mailsecurity2.patch | 53 - php-oracle9.patch | 23 - php-pdflib4.0.2.patch | 802 ------------ php-pearinstall.patch | 24 - php-register_shutdown_function.patch | 19 - php-xml_fix | 11 - 15 files changed, 3441 deletions(-) delete mode 100644 php-4.1.2-dom-xslt-patch delete mode 100644 php-ZVAL.patch delete mode 100644 php-ac250.patch delete mode 100644 php-am_ac_lt.patch delete mode 100644 php-apache2.patch delete mode 100644 php-domxml_node.patch delete mode 100644 php-image_c.patch delete mode 100644 php-imap.patch delete mode 100644 php-libxml2.patch delete mode 100644 php-mailsecurity2.patch delete mode 100644 php-oracle9.patch delete mode 100644 php-pdflib4.0.2.patch delete mode 100644 php-pearinstall.patch delete mode 100644 php-register_shutdown_function.patch delete mode 100644 php-xml_fix diff --git a/php-4.1.2-dom-xslt-patch b/php-4.1.2-dom-xslt-patch deleted file mode 100644 index 0d0d65a..0000000 --- a/php-4.1.2-dom-xslt-patch +++ /dev/null @@ -1,1802 +0,0 @@ -diff -upr php-4.1.2/ext/domxml/config.m4 php-4.1.2-dom-xslt/ext/domxml/config.m4 ---- php-4.1.2/ext/domxml/config.m4 Thu Oct 4 08:42:45 2001 -+++ php-4.1.2-dom-xslt/ext/domxml/config.m4 Fri Jan 18 08:58:47 2002 -@@ -1,5 +1,6 @@ --dnl $Id$ --dnl config.m4 for extension domxml -+dnl -+dnl $Id$ -+dnl - - AC_DEFUN(PHP_DOM_CHECK_VERSION,[ - old_CPPFLAGS=$CPPFLAGS -@@ -20,17 +21,16 @@ AC_DEFUN(PHP_DOM_CHECK_VERSION,[ - - PHP_ARG_WITH(dom, for DOM support, - [ --with-dom[=DIR] Include DOM support (requires libxml >= 2.4.2). -- DIR is the libxml install directory, -- defaults to /usr.]) -+ DIR is the libxml install directory.]) - - if test "$PHP_DOM" != "no"; then - - DOMXML_DIR_ADD="" -- if test -r $PHP_DOM/include/libxml/tree.h; then -- DOMXML_DIR=$PHP_DOM -- elif test -r $PHP_DOM/include/libxml2/libxml/tree.h; then -+ if test -r $PHP_DOM/include/libxml2/libxml/tree.h; then - DOMXML_DIR=$PHP_DOM - DOMXML_DIR_ADD="/libxml2" -+ elif test -r $PHP_DOM/include/libxml/tree.h; then -+ DOMXML_DIR=$PHP_DOM - else - for i in /usr/local /usr; do - test -r $i/include/libxml/tree.h && DOMXML_DIR=$i -@@ -63,4 +63,110 @@ if test "$PHP_DOM" != "no"; then - AC_DEFINE(HAVE_DOMXML,1,[ ]) - PHP_EXTENSION(domxml, $ext_shared) - PHP_SUBST(DOMXML_SHARED_LIBADD) -+fi -+ -+AC_DEFUN(PHP_DOM_XSLT_CHECK_VERSION,[ -+ old_CPPFLAGS=$CPPFLAGS -+ CPPFLAGS=-I$DOMXSLT_DIR/include -+ AC_MSG_CHECKING(for libxslt version) -+ AC_EGREP_CPP(yes,[ -+ #include -+ #if LIBXSLT_VERSION >= 10003 -+ yes -+ #endif -+ ],[ -+ AC_MSG_RESULT(>= 1.0.3) -+ ],[ -+ AC_MSG_ERROR(libxslt version 1.0.3 or greater required.) -+ ]) -+ CPPFLAGS=$old_CPPFLAGS -+]) -+ -+AC_DEFUN(PHP_DOM_EXSLT_CHECK_VERSION,[ -+ old_CPPFLAGS=$CPPFLAGS -+ CPPFLAGS=-I$DOMEXSLT_DIR/include -+ AC_MSG_CHECKING(for libexslt version) -+ AC_EGREP_CPP(yes,[ -+ #include -+ #if LIBEXSLT_VERSION >= 600 -+ yes -+ #endif -+ ],[ -+ AC_MSG_RESULT(>= 1.0.3) -+ ],[ -+ AC_MSG_ERROR(libxslt version 1.0.3 or greater required.) -+ ]) -+ CPPFLAGS=$old_CPPFLAGS -+]) -+ -+PHP_ARG_WITH(dom-xslt, for DOM XSLT support, -+[ --with-dom-xslt[=DIR] Include DOM XSLT support (requires libxslt >= 1.0.3). -+ DIR is the libxslt install directory.]) -+ -+PHP_ARG_WITH(dom-exslt, for DOM EXSLT support, -+[ --with-dom-exslt[=DIR] Include DOM EXSLT support (requires libxslt >= 1.0.3). -+ DIR is the libexslt install directory.]) -+ -+if test "$PHP_DOM_XSLT" != "no"; then -+ -+ if test -r $PHP_DOM_XSLT/include/libxslt/transform.h; then -+ DOMXSLT_DIR=$PHP_DOM_XSLT -+ else -+ for i in /usr/local /usr; do -+ test -r $i/include/libxslt/transform.h && DOMXSLT_DIR=$i -+ done -+ fi -+ -+ if test -z "$DOMXSLT_DIR"; then -+ AC_MSG_RESULT(not found) -+ AC_MSG_ERROR(Please reinstall the libxslt >= 1.0.3 distribution) -+ fi -+ -+ PHP_DOM_XSLT_CHECK_VERSION -+ -+ PHP_ADD_LIBRARY_WITH_PATH(xslt, $DOMXSLT_DIR/lib, DOMXML_SHARED_LIBADD) -+ -+ PHP_ADD_INCLUDE($DOMXSLT_DIR/include) -+ -+ if test "$PHP_DOM" = "no"; then -+ AC_MSG_ERROR(DOMXSLT requires DOMXML. Use --with-dom=) -+ fi -+ -+ AC_DEFINE(HAVE_DOMXSLT,1,[ ]) -+ -+ PHP_SUBST(DOMXML_SHARED_LIBADD) -+fi -+ -+if test "$PHP_DOM_EXSLT" != "no"; then -+ if test "$PHP_DOM" = "no"; then -+ AC_MSG_ERROR(DOMEXSLT requires DOMXML. Use --with-dom=) -+ fi -+ -+ if test "$PHP_DOM_XSLT" = "no"; then -+ AC_MSG_ERROR(DOMEXSLT requires DOMXSLT. Use --with-dom-xslt=) -+ fi -+ -+ if test -r $PHP_DOM_EXSLT/include/libexslt/exslt.h; then -+ DOMEXSLT_DIR=$PHP_DOM_EXSLT -+ else -+ for i in /usr/local /usr; do -+ test -r $i/include/libexslt/exslt.h && DOMEXSLT_DIR=$i -+ done -+ fi -+ -+ if test -z "$DOMEXSLT_DIR"; then -+ AC_MSG_RESULT(not found) -+ AC_MSG_ERROR(Please reinstall the libxslt >= 1.0.3 distribution) -+ fi -+ -+ PHP_DOM_EXSLT_CHECK_VERSION -+ -+ PHP_ADD_LIBRARY_WITH_PATH(exslt, $DOMEXSLT_DIR/lib, DOMXML_SHARED_LIBADD) -+ -+ PHP_ADD_INCLUDE($DOMEXSLT_DIR/include) -+ -+ AC_DEFINE(HAVE_DOMEXSLT,1,[ ]) -+ -+ PHP_SUBST(DOMXML_SHARED_LIBADD) -+ - fi -diff -upr php-4.1.2/ext/domxml/php_domxml.c php-4.1.2-dom-xslt/ext/domxml/php_domxml.c ---- php-4.1.2/ext/domxml/php_domxml.c Fri Dec 14 11:45:46 2001 -+++ php-4.1.2-dom-xslt/ext/domxml/php_domxml.c Tue Feb 26 17:03:46 2002 -@@ -16,7 +16,11 @@ - +----------------------------------------------------------------------+ - */ - --/* $Id$ */ -+/* $Id$ */ -+ -+/* TODO -+ * - Support Notation Nodes -+ * */ - - - #ifdef HAVE_CONFIG_H -@@ -33,7 +37,7 @@ - - /* General macros used by domxml */ - #define DOMXML_DOMOBJ_NEW(zval, obj, ret) if (NULL == (zval = php_domobject_new(obj, ret TSRMLS_CC))) { \ -- php_error(E_WARNING, "%s() cannot create required DOM object", \ -+ php_error(E_WARNING, "%s(): cannot create required DOM object", \ - get_active_function_name(TSRMLS_C)); \ - RETURN_FALSE; \ - } -@@ -46,13 +50,13 @@ - DOMXML_RET_ZVAL(zval); - - #define DOMXML_GET_THIS(zval) if (NULL == (zval = getThis())) { \ -- php_error(E_WARNING, "%s() underlying object missing", \ -+ php_error(E_WARNING, "%s(): underlying object missing", \ - get_active_function_name(TSRMLS_C)); \ - RETURN_FALSE; \ - } - - #define DOMXML_GET_OBJ(ret, zval, le) if (NULL == (ret = php_dom_get_object(zval, le, 0 TSRMLS_CC))) { \ -- php_error(E_WARNING, "%s() cannot fetch DOM object", \ -+ php_error(E_WARNING, "%s(): cannot fetch DOM object", \ - get_active_function_name(TSRMLS_C)); \ - RETURN_FALSE; \ - } -@@ -80,6 +84,17 @@ - } \ - DOMXML_GET_OBJ(ret, zval, le); - -+#define DOMXML_PARAM_ONE(ret, zval, le, s, p1) if (NULL == (zval = getThis())) { \ -+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o"s, &zval, p1) == FAILURE) { \ -+ return; \ -+ } \ -+ } else { \ -+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, p1) == FAILURE) { \ -+ return; \ -+ } \ -+ } \ -+ DOMXML_GET_OBJ(ret, zval, le); -+ - #define DOMXML_PARAM_TWO(ret, zval, le, s, p1, p2) if (NULL == (zval = getThis())) { \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o"s, &zval, p1, p2) == FAILURE) { \ - return; \ -@@ -91,6 +106,18 @@ - } \ - DOMXML_GET_OBJ(ret, zval, le); - -+#define DOMXML_PARAM_THREE(ret, zval, le, s, p1, p2, p3) if (NULL == (zval = getThis())) { \ -+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o"s, &zval, p1, p2, p3) == FAILURE) { \ -+ return; \ -+ } \ -+ } else { \ -+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, p1, p2, p3) == FAILURE) { \ -+ return; \ -+ } \ -+ } \ -+ DOMXML_GET_OBJ(ret, zval, le); -+ -+ - #define DOMXML_PARAM_FOUR(ret, zval, le, s, p1, p2, p3, p4) if (NULL == (zval = getThis())) { \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o"s, &zval, p1, p2, p3, p4) == FAILURE) { \ - return; \ -@@ -102,6 +129,7 @@ - } \ - DOMXML_GET_OBJ(ret, zval, le); - -+ - static int le_domxmldocp; - static int le_domxmldoctypep; - static int le_domxmldtdp; -@@ -116,6 +144,9 @@ static int le_domxmlnotationp; - /*static int le_domxmlentityp;*/ - static int le_domxmlentityrefp; - /*static int le_domxmlnsp;*/ -+#if HAVE_DOMXSLT -+static int le_domxsltstylesheetp; -+#endif - - #if defined(LIBXML_XPATH_ENABLED) - static int le_xpathctxp; -@@ -140,6 +171,9 @@ zend_class_entry *domxmlns_class_entry; - zend_class_entry *xpathctx_class_entry; - zend_class_entry *xpathobject_class_entry; - #endif -+#if HAVE_DOMXSLT -+zend_class_entry *domxsltstylesheet_class_entry; -+#endif - - - static int node_attributes(zval **attributes, xmlNode *nodep TSRMLS_DC); -@@ -149,28 +183,48 @@ static zend_function_entry domxml_functi - PHP_FE(domxml_version, NULL) - PHP_FE(xmldoc, NULL) - PHP_FE(xmldocfile, NULL) -+#if defined(LIBXML_HTML_ENABLED) -+ PHP_FE(html_doc, NULL) -+ 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_dumpmem, NULL) -+ PHP_FE(domxml_dump_mem, NULL) -+ PHP_FE(domxml_dump_mem_file, NULL) -+ PHP_FE(domxml_dump_node, NULL) -+#if defined(LIBXML_HTML_ENABLED) -+ PHP_FE(domxml_html_dump_mem, NULL) -+#endif - PHP_FE(domxml_node_attributes, NULL) - PHP_FE(domxml_elem_get_attribute, NULL) - PHP_FE(domxml_elem_set_attribute, NULL) - PHP_FE(domxml_node_children, NULL) -+ PHP_FE(domxml_node_has_attributes, NULL) - PHP_FE(domxml_node_new_child, NULL) - PHP_FE(domxml_node, NULL) - PHP_FE(domxml_node_unlink_node, NULL) - PHP_FE(domxml_node_set_content, NULL) -+ PHP_FE(domxml_node_get_content, NULL) - PHP_FE(domxml_new_xmldoc, NULL) - - #if defined(LIBXML_XPATH_ENABLED) - PHP_FE(xpath_new_context, NULL) - PHP_FE(xpath_eval, NULL) - PHP_FE(xpath_eval_expression, NULL) -+ PHP_FE(xpath_register_ns, NULL) - #endif - #if defined(LIBXML_XPTR_ENABLED) - PHP_FE(xptr_new_context, NULL) - PHP_FE(xptr_eval, NULL) - #endif -+#if HAVE_DOMXSLT -+ PHP_FE(domxml_xslt_version, NULL) -+ PHP_FE(domxml_xslt_stylesheet, NULL) -+ PHP_FE(domxml_xslt_stylesheet_doc, NULL) -+ PHP_FE(domxml_xslt_stylesheet_file, NULL) -+ PHP_FE(domxml_xslt_process, NULL) -+#endif - - PHP_FALIAS(domxml_root, domxml_doc_document_element, NULL) - PHP_FALIAS(domxml_attributes, domxml_node_attributes, NULL) -@@ -183,6 +237,8 @@ static zend_function_entry domxml_functi - PHP_FALIAS(domxml_unlink_node, domxml_node_unlink_node, NULL) - PHP_FALIAS(set_content, domxml_node_set_content, NULL) - PHP_FALIAS(new_xmldoc, domxml_new_xmldoc, NULL) -+ PHP_FALIAS(domxml_dumpmem, domxml_dump_mem, NULL) -+ - {NULL, NULL, NULL} - }; - -@@ -206,7 +262,12 @@ static function_entry php_domxmldoc_clas - PHP_FALIAS(add_root, domxml_add_root, NULL) - PHP_FALIAS(imported_node, domxml_doc_imported_node, NULL) - PHP_FALIAS(dtd, domxml_intdtd, NULL) -- PHP_FALIAS(dumpmem, domxml_dumpmem, NULL) -+ PHP_FALIAS(dumpmem, domxml_dump_mem, NULL) -+ PHP_FALIAS(dump_mem, domxml_dump_mem, NULL) -+ PHP_FALIAS(dump_mem_file, domxml_dump_mem_file, NULL) -+#if defined(LIBXML_HTML_ENABLED) -+ PHP_FALIAS(html_dump_mem, domxml_html_dump_mem, NULL) -+#endif - #if defined(LIBXML_XPATH_ENABLED) - PHP_FALIAS(xpath_init, xpath_init, NULL) - PHP_FALIAS(xpath_new_context, xpath_new_context, NULL) -@@ -217,13 +278,13 @@ static function_entry php_domxmldoc_clas - - static function_entry php_domxmldoctype_class_functions[] = { - PHP_FALIAS(name, domxml_doctype_name, NULL) --/* -+/* - PHP_FALIAS(entities, domxml_doctype_entities, NULL) - PHP_FALIAS(notations, domxml_doctype_notations, NULL) - PHP_FALIAS(system_id, domxml_doctype_system_id, NULL) - PHP_FALIAS(public_id, domxml_doctype_public_id, NULL) - PHP_FALIAS(internal_subset, domxml_doctype_internal_subset, NULL) --*/ -+*/ - {NULL, NULL, NULL} - }; - -@@ -249,16 +310,20 @@ static zend_function_entry php_domxmlnod - PHP_FALIAS(owner_document, domxml_node_owner_document, NULL) - PHP_FALIAS(new_child, domxml_node_new_child, NULL) - PHP_FALIAS(attributes, domxml_node_attributes, NULL) -+ PHP_FALIAS(has_attributes, domxml_node_has_attributes, NULL) - PHP_FALIAS(node, domxml_node, NULL) - PHP_FALIAS(unlink, domxml_node_unlink_node, NULL) -+ PHP_FALIAS(replace_node, domxml_node_replace_node, NULL) - PHP_FALIAS(set_content, domxml_node_set_content, NULL) -+ PHP_FALIAS(get_content, domxml_node_get_content, NULL) - PHP_FALIAS(text_concat, domxml_node_text_concat, NULL) - PHP_FALIAS(set_name, domxml_node_set_name, NULL) - PHP_FALIAS(node_name, domxml_node_name, NULL) - PHP_FALIAS(node_type, domxml_node_type, NULL) - PHP_FALIAS(node_value, domxml_node_value, NULL) - PHP_FALIAS(clone_node, domxml_clone_node, NULL) -- PHP_FALIAS(is_blank_node, domxml_is_blank_node, NULL) -+ PHP_FALIAS(is_blank_node, domxml_is_blank_node, NULL) -+ PHP_FALIAS(dump_node, domxml_dump_node, NULL) - {NULL, NULL, NULL} - }; - -@@ -299,7 +364,7 @@ static zend_function_entry php_domxmlent - }; - - static zend_function_entry php_domxmlentity_class_functions[] = { --/* -+/* - PHP_FALIAS(public_id, domxml_entity_public_id, NULL) - PHP_FALIAS(system_id, domxml_entity_system_id, NULL) - PHP_FALIAS(notation_name, domxml_entity_notation_name, NULL) -@@ -317,6 +382,7 @@ static zend_function_entry php_domxmlpi_ - static zend_function_entry php_xpathctx_class_functions[] = { - PHP_FALIAS(xpath_eval, xpath_eval, NULL) - PHP_FALIAS(xpath_eval_expression, xpath_eval_expression, NULL) -+ PHP_FALIAS(xpath_register_ns, xpath_register_ns, NULL) - {NULL, NULL, NULL} - }; - -@@ -329,7 +395,7 @@ static zend_function_entry php_domxmlatt - PHP_FALIAS(name, domxml_attr_name, NULL) - PHP_FALIAS(value, domxml_attr_value, NULL) - PHP_FALIAS(specified, domxml_attr_specified, NULL) --/* -+/* - PHP_FALIAS(owner_element, domxml_attr_owner_element, NULL) - */ - {NULL, NULL, NULL} -@@ -339,8 +405,16 @@ static zend_function_entry php_domxmlns_ - {NULL, NULL, NULL} - }; - -+#if HAVE_DOMXSLT -+static zend_function_entry php_domxsltstylesheet_class_functions[] = { -+/* TODO: maybe some more methods? */ -+ PHP_FALIAS(process, domxml_xslt_process, NULL) -+ {NULL, NULL, NULL} -+}; -+#endif -+ - zend_module_entry domxml_module_entry = { -- STANDARD_MODULE_HEADER, -+ STANDARD_MODULE_HEADER, - "domxml", - domxml_functions, - PHP_MINIT(domxml), -@@ -348,7 +422,7 @@ zend_module_entry domxml_module_entry = - PHP_RINIT(domxml), - NULL, - PHP_MINFO(domxml), -- NO_VERSION_YET, -+ NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES - }; - -@@ -370,14 +444,14 @@ static void dom_object_set_data(void *ob - - static zval *dom_object_get_data(void *obj) - { --/* -+/* - char tmp[20]; - sprintf(tmp, "%08X", obj); - fprintf(stderr, "Trying getting %s from object ...", tmp); - if(((xmlNodePtr) obj)->_private) - fprintf(stderr, " found\n"); - else -- fprintf(stderr, " not found\n"); -+ fprintf(stderr, " not found\n"); - */ - return ((zval *) (((xmlNodePtr) obj)->_private)); - } -@@ -411,9 +485,14 @@ static inline void node_list_wrapper_dto - { - while (node != NULL) { - node_list_wrapper_dtor(node->children); -- // FIXME temporary fix; think of something better -- if (node->type != XML_ATTRIBUTE_DECL && node->type != XML_DTD_NODE) { -- attr_list_wrapper_dtor(node->properties); -+ switch (node->type) { -+ /* Skip property freeing for the following types */ -+ case XML_ATTRIBUTE_DECL: -+ case XML_DTD_NODE: -+ case XML_ENTITY_DECL: -+ break; -+ default: -+ attr_list_wrapper_dtor(node->properties); - } - node_wrapper_dtor(node); - node = node->next; -@@ -474,6 +553,92 @@ static void php_free_xpath_object(zend_r - #endif - - -+#if HAVE_DOMXSLT -+static void php_free_xslt_stylesheet(zend_rsrc_list_entry *rsrc TSRMLS_DC) -+{ -+ xsltStylesheetPtr sheet = (xsltStylesheetPtr) rsrc->ptr; -+ -+ if (sheet) { -+ node_wrapper_dtor((xmlNodePtr) sheet); -+ xsltFreeStylesheet(sheet); -+ } -+} -+ -+static void xsltstylesheet_set_data(void *obj, zval *wrapper) -+{ -+/* -+ char tmp[20]; -+ sprintf(tmp, "%08X", obj); -+ fprintf(stderr, "Adding %s to hash\n", tmp); -+*/ -+ ((xsltStylesheetPtr) obj)->_private = wrapper; -+} -+ -+ -+static zval *xsltstylesheet_get_data(void *obj) -+{ -+/* -+ char tmp[20]; -+ sprintf(tmp, "%08X", obj); -+ fprintf(stderr, "Trying getting %s from object ...", tmp); -+ if(((xmlNodePtr) obj)->_private) -+ fprintf(stderr, " found\n"); -+ else -+ fprintf(stderr, " not found\n"); -+*/ -+ return ((zval *) (((xsltStylesheetPtr) obj)->_private)); -+} -+ -+void *php_xsltstylesheet_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC) -+{ -+ void *obj; -+ zval **handle; -+ int type; -+ -+ if (NULL == wrapper) { -+ php_error(E_WARNING, "xsltstylesheet_get_object() invalid wrapper object passed"); -+ return NULL; -+ } -+ -+ if (Z_TYPE_P(wrapper) != IS_OBJECT) { -+ php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name(TSRMLS_C)); -+ return NULL; -+ } -+ -+ if (zend_hash_index_find(Z_OBJPROP_P(wrapper), 0, (void **) &handle) == FAILURE) { -+ php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name(TSRMLS_C)); -+ return NULL; -+ } -+ -+ obj = zend_list_find(Z_LVAL_PP(handle), &type); -+ if (!obj || ((type != rsrc_type1) && (type != rsrc_type2))) { -+ php_error(E_WARNING, "%s(): underlying object missing or of invalid type", get_active_function_name(TSRMLS_C)); -+ return NULL; -+ } -+ -+ return obj; -+} -+ -+static void php_xsltstylesheet_set_object(zval *wrapper, void *obj, int rsrc_type) -+{ -+ zval *handle, *addr; -+ -+ MAKE_STD_ZVAL(handle); -+ Z_TYPE_P(handle) = IS_LONG; -+ Z_LVAL_P(handle) = zend_list_insert(obj, rsrc_type); -+ -+ MAKE_STD_ZVAL(addr); -+ Z_TYPE_P(addr) = IS_LONG; -+ Z_LVAL_P(addr) = (int) obj; -+ -+ zend_hash_index_update(Z_OBJPROP_P(wrapper), 0, &handle, sizeof(zval *), NULL); -+ zend_hash_index_update(Z_OBJPROP_P(wrapper), 1, &addr, sizeof(zval *), NULL); -+ zval_add_ref(&wrapper); -+ xsltstylesheet_set_data(obj, wrapper); -+} -+#endif /* HAVE_DOMXSLT */ -+ -+ - void *php_xpath_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC) - { - void *obj; -@@ -486,18 +651,18 @@ void *php_xpath_get_object(zval *wrapper - } - - if (Z_TYPE_P(wrapper) != IS_OBJECT) { -- php_error(E_WARNING, "%s() wrapper is not an object", get_active_function_name(TSRMLS_C)); -+ php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name(TSRMLS_C)); - return NULL; - } - - if (zend_hash_index_find(Z_OBJPROP_P(wrapper), 0, (void **) &handle) == FAILURE) { -- php_error(E_WARNING, "%s() underlying object missing", get_active_function_name(TSRMLS_C)); -+ php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name(TSRMLS_C)); - return NULL; - } - - obj = zend_list_find(Z_LVAL_PP(handle), &type); - if (!obj || ((type != rsrc_type1) && (type != rsrc_type2))) { -- php_error(E_WARNING, "%s() underlying object missing or of invalid type", get_active_function_name(TSRMLS_C)); -+ php_error(E_WARNING, "%s(): underlying object missing or of invalid type", get_active_function_name(TSRMLS_C)); - return NULL; - } - -@@ -507,7 +672,7 @@ void *php_xpath_get_object(zval *wrapper - - static void xpath_object_set_data(void *obj, zval *wrapper) - { --/* -+/* - char tmp[20]; - sprintf(tmp, "%08X", obj); - fprintf(stderr, "Adding %s to hash\n", tmp); -@@ -518,12 +683,12 @@ static void xpath_object_set_data(void * - - static zval *xpath_object_get_data(void *obj) - { --/* -+/* - char tmp[20]; - sprintf(tmp, "%08X", obj); -- fprintf(stderr, "Trying getting %s from hash ...", tmp); -+ fprintf(stderr, "Trying getting %s from hash ...", tmp); - if(((xmlXPathObjectPtr) obj)->user) -- fprintf(stderr, " found\n"); -+ fprintf(stderr, " found\n"); - else - fprintf(stderr, " not found\n"); - */ -@@ -574,7 +739,7 @@ static zval *php_xpathobject_new(xmlXPat - - /* - rsrc_type = le_xpathobjectp; -- php_xpath_set_object(wrapper, (void *) obj, rsrc_type); -+ php_xpath_set_object(wrapper, (void *) obj, rsrc_type); - */ - - php_xpath_set_object(wrapper, (void *) obj, le_xpathobjectp); -@@ -594,19 +759,19 @@ void *php_xpath_get_context(zval *wrappe - } - - if (Z_TYPE_P(wrapper) != IS_OBJECT) { -- php_error(E_WARNING, "%s() wrapper is not an object", get_active_function_name(TSRMLS_C)); -+ php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name(TSRMLS_C)); - return NULL; - } - - if (zend_hash_index_find(Z_OBJPROP_P(wrapper), 0, (void **) &handle) == - FAILURE) { -- php_error(E_WARNING, "%s() underlying object missing", get_active_function_name(TSRMLS_C)); -+ php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name(TSRMLS_C)); - return NULL; - } - - obj = zend_list_find(Z_LVAL_PP(handle), &type); - if (!obj || ((type != rsrc_type1) && (type != rsrc_type2))) { -- php_error(E_WARNING, "%s() Underlying object missing or of invalid type", get_active_function_name(TSRMLS_C)); -+ php_error(E_WARNING, "%s(): underlying object missing or of invalid type", get_active_function_name(TSRMLS_C)); - return NULL; - } - -@@ -628,9 +793,9 @@ static zval *xpath_context_get_data(void - /* - char tmp[20]; - sprintf(tmp, "%08X", obj); -- fprintf(stderr, "Trying getting %s from hash ...", tmp); -+ fprintf(stderr, "Trying getting %s from hash ...", tmp); - if(((xmlXPathContextPtr) obj)->user) -- fprintf(stderr, " found\n"); -+ fprintf(stderr, " found\n"); - else - fprintf(stderr, " not found\n"); - */ -@@ -661,7 +826,7 @@ static zval *php_xpathcontext_new(xmlXPa - int rsrc_type; - - if (! found) { -- *found = 0; -+ *found = 0; - } - - if (!obj) { -@@ -677,8 +842,8 @@ static zval *php_xpathcontext_new(xmlXPa - } - - MAKE_STD_ZVAL(wrapper); --/* -- fprintf(stderr, "Adding new XPath Context\n"); -+/* -+ fprintf(stderr, "Adding new XPath Context\n"); - */ - object_init_ex(wrapper, xpathctx_class_entry); - rsrc_type = le_xpathctxp; -@@ -700,12 +865,12 @@ void *php_dom_get_object(zval *wrapper, - } - - if (Z_TYPE_P(wrapper) != IS_OBJECT) { -- php_error(E_WARNING, "%s() wrapper is not an object", get_active_function_name(TSRMLS_C)); -+ php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name(TSRMLS_C)); - return NULL; - } - - if (zend_hash_index_find(Z_OBJPROP_P(wrapper), 0, (void **) &handle) == FAILURE) { -- php_error(E_WARNING, "%s() underlying object missing", get_active_function_name(TSRMLS_C)); -+ php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name(TSRMLS_C)); - return NULL; - } - -@@ -713,7 +878,7 @@ void *php_dom_get_object(zval *wrapper, - - /* The following test should be replaced with search in all parents */ - if (!obj) { /* || ((type != rsrc_type1) && (type != rsrc_type2))) { */ -- php_error(E_WARNING, "%s() underlying object missing or of invalid type", get_active_function_name(TSRMLS_C)); -+ php_error(E_WARNING, "%s(): underlying object missing or of invalid type", get_active_function_name(TSRMLS_C)); - return NULL; - } - -@@ -747,7 +912,7 @@ static zval *php_domobject_new(xmlNodePt - int rsrc_type; - - if (! found) { -- *found = 0; -+ *found = 0; - } - - if (!obj) { -@@ -795,8 +960,10 @@ static zval *php_domobject_new(xmlNodePt - object_init_ex(wrapper, domxmlcomment_class_entry); - rsrc_type = le_domxmlcommentp; - content = xmlNodeGetContent(nodep); -- if (content) -+ if (content) { -+ add_property_long(wrapper, "type", Z_TYPE_P(nodep)); - add_property_stringl(wrapper, "content", (char *) content, strlen(content), 1); -+ } - break; - } - -@@ -817,7 +984,6 @@ static zval *php_domobject_new(xmlNodePt - xmlNodePtr nodep = obj; - object_init_ex(wrapper, domxmlentityref_class_entry); - rsrc_type = le_domxmlentityrefp; -- content = xmlNodeGetContent(nodep); - add_property_stringl(wrapper, "name", (char *) nodep->name, strlen(nodep->name), 1); - break; - } -@@ -851,8 +1017,10 @@ static zval *php_domobject_new(xmlNodePt - } - - case XML_DOCUMENT_NODE: -+ case XML_HTML_DOCUMENT_NODE: - { - xmlDocPtr docp = (xmlDocPtr) obj; -+ - object_init_ex(wrapper, domxmldoc_class_entry); - rsrc_type = le_domxmldocp; - if (docp->name) -@@ -863,7 +1031,10 @@ static zval *php_domobject_new(xmlNodePt - add_property_stringl(wrapper, "url", (char *) docp->URL, strlen(docp->URL), 1); - else - add_property_stringl(wrapper, "url", "", 0, 1); -- add_property_stringl(wrapper, "version", (char *) docp->version, strlen(docp->version), 1); -+ if (docp->version) -+ add_property_stringl(wrapper, "version", (char *) docp->version, strlen(docp->version), 1); -+ else -+ add_property_stringl(wrapper, "version", "", 0, 1); - if (docp->encoding) - add_property_stringl(wrapper, "encoding", (char *) docp->encoding, strlen(docp->encoding), 1); - add_property_long(wrapper, "standalone", docp->standalone); -@@ -900,8 +1071,8 @@ static zval *php_domobject_new(xmlNodePt - break; - } - -- default: -- php_error(E_WARNING, "%s() unsupported node type: %d\n", get_active_function_name(TSRMLS_C), Z_TYPE_P(obj)); -+ default: -+ php_error(E_WARNING, "%s(): unsupported node type: %d\n", get_active_function_name(TSRMLS_C), Z_TYPE_P(obj)); - FREE_ZVAL(wrapper); - return NULL; - } -@@ -911,6 +1082,17 @@ static zval *php_domobject_new(xmlNodePt - } - - -+static void domxml_error(void *ctx, const char *msg, ...) -+{ -+ char buf[1024]; -+ va_list ap; -+ va_start(ap, msg); -+ vsnprintf(buf, 1024, msg, ap); -+ va_end(ap); -+ php_error(E_WARNING, buf); -+} -+ -+ - PHP_RINIT_FUNCTION(domxml) - { - return SUCCESS; -@@ -932,12 +1114,12 @@ PHP_MINIT_FUNCTION(domxml) - le_domxmlelementp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domelement", module_number); - le_domxmldtdp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domdtd", module_number); - le_domxmlcdatap = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domcdata", module_number); -+ le_domxmlentityrefp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domentityref", module_number); -+ le_domxmlpip = zend_register_list_destructors_ex(php_free_xml_node, NULL, "dompi", module_number); - - /* Not yet initialized le_*s */ - le_domxmldoctypep = -10000; -- le_domxmlpip = -10002; - le_domxmlnotationp = -10003; -- le_domxmlentityrefp = -10004; - - #if defined(LIBXML_XPATH_ENABLED) - le_xpathctxp = zend_register_list_destructors_ex(php_free_xpath_context, NULL, "xpathcontext", module_number); -@@ -946,6 +1128,10 @@ PHP_MINIT_FUNCTION(domxml) - - /* le_domxmlnsp = register_list_destructors(NULL, NULL); */ - -+#if HAVE_DOMXSLT -+ le_domxsltstylesheetp = zend_register_list_destructors_ex(php_free_xslt_stylesheet, NULL, "xsltstylesheet", module_number); -+#endif -+ - INIT_OVERLOADED_CLASS_ENTRY(ce, "DomNode", php_domxmlnode_class_functions, NULL, NULL, NULL); - domxmlnode_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); - -@@ -996,6 +1182,11 @@ PHP_MINIT_FUNCTION(domxml) - xpathobject_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); - #endif - -+#if HAVE_DOMXSLT -+ INIT_OVERLOADED_CLASS_ENTRY(ce, "XsltStylesheet", php_domxsltstylesheet_class_functions, NULL, NULL, NULL); -+ domxsltstylesheet_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); -+#endif -+ - REGISTER_LONG_CONSTANT("XML_ELEMENT_NODE", XML_ELEMENT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NODE", XML_ATTRIBUTE_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_TEXT_NODE", XML_TEXT_NODE, CONST_CS | CONST_PERSISTENT); -@@ -1040,6 +1231,15 @@ PHP_MINIT_FUNCTION(domxml) - REGISTER_LONG_CONSTANT("XPATH_USERS", XPATH_USERS, CONST_CS | CONST_PERSISTENT); - #endif - -+ xmlSetGenericErrorFunc(xmlGenericErrorContext, (xmlGenericErrorFunc)domxml_error); -+#if HAVE_DOMXSLT -+ xsltSetGenericErrorFunc(xsltGenericErrorContext, (xmlGenericErrorFunc)domxml_error); -+#if HAVE_DOMEXSLT -+ exsltRegisterAll(); -+#endif -+#endif -+ -+ - return SUCCESS; - } - -@@ -1065,12 +1265,24 @@ PHP_MINFO_FUNCTION(domxml) - php_info_print_table_start(); - php_info_print_table_row(2, "DOM/XML", "enabled"); - php_info_print_table_row(2, "libxml Version", LIBXML_DOTTED_VERSION); -+#if defined(LIBXML_HTML_ENABLED) -+ php_info_print_table_row(2, "HTML Support", "enabled"); -+#endif - #if defined(LIBXML_XPATH_ENABLED) - php_info_print_table_row(2, "XPath Support", "enabled"); - #endif - #if defined(LIBXML_XPTR_ENABLED) - php_info_print_table_row(2, "XPointer Support", "enabled"); - #endif -+#if HAVE_DOMXSLT -+ php_info_print_table_row(2, "DOM/XSLT", "enabled"); -+ php_info_print_table_row(2, "libxslt Version", LIBXSLT_DOTTED_VERSION); -+#if HAVE_DOMEXSLT -+ php_info_print_table_row(2, "DOM/EXSLT", "enabled"); -+ php_info_print_table_row(2, "libexslt Version", LIBEXSLT_DOTTED_VERSION); -+#endif -+#endif -+ - php_info_print_table_end(); - } - -@@ -1318,13 +1530,13 @@ PHP_FUNCTION(domxml_is_blank_node) - PHP_FUNCTION(domxml_node_type) - { - zval *id; -- xmlNode *n; -+ xmlNode *node; - -- DOMXML_GET_THIS_OBJ(n, id, le_domxmlnodep); -+ DOMXML_GET_THIS_OBJ(node, id, le_domxmlnodep); - - DOMXML_NO_ARGS(); - -- RETURN_LONG(Z_TYPE_P(n)); -+ RETURN_LONG(node->type); - } - /* }}} */ - -@@ -1533,7 +1745,7 @@ PHP_FUNCTION(domxml_node_parent) - int ret; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); -- -+ - DOMXML_NO_ARGS(); - - last = nodep->parent; -@@ -1558,7 +1770,7 @@ PHP_FUNCTION(domxml_node_children) - /* Even if the nodep is a XML_DOCUMENT_NODE the type is at the - same position. - */ -- if (Z_TYPE_P(nodep) == XML_DOCUMENT_NODE) -+ if ((Z_TYPE_P(nodep) == XML_DOCUMENT_NODE) || (Z_TYPE_P(nodep) == XML_HTML_DOCUMENT_NODE)) - last = ((xmlDoc *) nodep)->children; - else - last = nodep->children; -@@ -1579,32 +1791,27 @@ PHP_FUNCTION(domxml_node_children) - } - /* }}} */ - --/* {{{ proto object domxml_node_unlink_node(void) -- Deletes node */ -+/* {{{ proto void domxml_node_unlink_node([object node]) -+ Deletes the node */ - PHP_FUNCTION(domxml_node_unlink_node) - { - zval *id; - xmlNode *nodep; - -- DOMXML_NO_ARGS(); -- -- DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); -- -- DOMXML_NO_ARGS(); -+ DOMXML_PARAM_NONE(nodep, id, le_domxmlnodep); - - xmlUnlinkNode(nodep); - xmlFreeNode(nodep); - zval_dtor(id); /* This is not enough because the children won't be deleted */ -- RETURN_TRUE; - } - /* }}} */ - --/* {{{ proto object domxml_node_add_child(int domnode) -+/* {{{ proto object domxml_node_add_child(object domnode) - Adds existing node to parent node */ - PHP_FUNCTION(domxml_node_add_child) - { - zval *id, *rv, *node; -- xmlNodePtr child, nodep; -+ xmlNodePtr child, nodep, new_child; - int ret; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); -@@ -1615,10 +1822,20 @@ PHP_FUNCTION(domxml_node_add_child) - - DOMXML_GET_OBJ(child, node, le_domxmlnodep); - -- child = xmlAddChild(nodep, child); -+ if (child->type == XML_ATTRIBUTE_NODE) { -+ php_error(E_WARNING, "%s(): can't add attribute node", get_active_function_name(TSRMLS_C)); -+ RETURN_FALSE; -+ } -+ -+ if (NULL == (new_child = xmlCopyNode(child, 1))) { -+ php_error(E_WARNING, "%s(): unable to clone node", get_active_function_name(TSRMLS_C)); -+ RETURN_FALSE; -+ } -+ -+ child = xmlAddChild(nodep, new_child); - - if (NULL == child) { -- php_error(E_WARNING, "%s() couldn't add child", get_active_function_name(TSRMLS_C)); -+ php_error(E_WARNING, "%s(): couldn't add child", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - -@@ -1626,12 +1843,39 @@ PHP_FUNCTION(domxml_node_add_child) - } - /* }}} */ - --/* {{{ proto object domxml_node_append_child(int domnode) -+/* {{{ proto object domxml_node_replace_node(object domnode) -+ Replaces one node with another node */ -+PHP_FUNCTION(domxml_node_replace_node) -+{ -+ zval *id, *rv, *node; -+ xmlNodePtr repnode, nodep, new_repnode; -+ int ret; -+ -+ DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); -+ -+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &node) == FAILURE) { -+ return; -+ } -+ -+ DOMXML_GET_OBJ(repnode, node, le_domxmlnodep); -+ -+ if (NULL == (new_repnode = xmlCopyNode(repnode, 1))) { -+ php_error(E_WARNING, "%s(): unable to clone node", get_active_function_name(TSRMLS_C)); -+ RETURN_FALSE; -+ } -+ -+ repnode = xmlReplaceNode(nodep, new_repnode); -+ -+ DOMXML_RET_OBJ(rv, repnode, &ret); -+} -+/* }}} */ -+ -+/* {{{ proto object domxml_node_append_child(object domnode) - Adds node to list of children */ - PHP_FUNCTION(domxml_node_append_child) - { - zval *id, *rv, *node; -- xmlNodePtr child, nodep; -+ xmlNodePtr child, nodep, new_child; - int ret; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); -@@ -1642,11 +1886,21 @@ PHP_FUNCTION(domxml_node_append_child) - - DOMXML_GET_OBJ(child, node, le_domxmlnodep); - -+ if (child->type == XML_ATTRIBUTE_NODE) { -+ php_error(E_WARNING, "%s(): can't append attribute node", get_active_function_name(TSRMLS_C)); -+ RETURN_FALSE; -+ } -+ -+ if (NULL == (new_child = xmlCopyNode(child, 1))) { -+ php_error(E_WARNING, "%s(): unable to clone node", get_active_function_name(TSRMLS_C)); -+ RETURN_FALSE; -+ } -+ - // FIXME reverted xmlAddChildList; crashes -- child = xmlAddSibling(nodep, child); -+ child = xmlAddSibling(nodep, new_child); - - if (NULL == child) { -- php_error(E_WARNING, "%s() couldn't add node", get_active_function_name(TSRMLS_C)); -+ php_error(E_WARNING, "%s(): couldn't append node", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - -@@ -1654,7 +1908,7 @@ PHP_FUNCTION(domxml_node_append_child) - } - /* }}} */ - --/* {{{ proto object domxml_node_insert_before(int newnode, int refnode) -+/* {{{ proto object domxml_node_insert_before(object newnode, object refnode) - Adds node in list of nodes before given node */ - PHP_FUNCTION(domxml_node_insert_before) - { -@@ -1674,7 +1928,7 @@ PHP_FUNCTION(domxml_node_insert_before) - child = xmlAddPrevSibling(refp, child); - - if (NULL == child) { -- php_error(E_WARNING, "%s() couldn't add newnode as the previous sibling of refnode", get_active_function_name(TSRMLS_C)); -+ php_error(E_WARNING, "%s(): couldn't add newnode as the previous sibling of refnode", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - -@@ -1783,11 +2037,35 @@ PHP_FUNCTION(domxml_node_set_content) - /* FIXME: Actually the property 'content' of the node has to be updated - as well. Since 'content' should disappear sooner or later and being - replaces by a function 'content()' I skip this for now -- */ -+ */ - RETURN_TRUE; - } - /* }}} */ - -+/* {{{ proto string domxml_node_get_content() -+ Gets content of a node. -+ -+ "Read the value of a node, this can be either the text carried directly by -+this node if it's a TEXT node or the aggregate string of the values carried by -+this node child's (TEXT and ENTITY_REF). Entity references are substituted." -+ */ -+PHP_FUNCTION(domxml_node_get_content) -+{ -+ zval *id; -+ xmlNode *nodep; -+ xmlChar *mem; -+ -+ DOMXML_PARAM_NONE(nodep, id, le_domxmlnodep); -+ mem = xmlNodeGetContent(nodep); -+ if (!mem) { -+ RETURN_FALSE; -+ } -+ -+ RETURN_STRING(mem,1); -+} -+/* }}} */ -+ -+ - /* End of Methods DomNode }}} */ - - -@@ -1902,7 +2180,7 @@ PHP_FUNCTION(domxml_elem_set_attribute) - - attr = xmlSetProp(nodep, name, value); - if (!attr) { -- php_error(E_WARNING, "%s() no such attribute '%s'", get_active_function_name(TSRMLS_C), name); -+ php_error(E_WARNING, "%s(): no such attribute '%s'", get_active_function_name(TSRMLS_C), name); - RETURN_FALSE; - } - -@@ -1966,7 +2244,7 @@ PHP_FUNCTION(domxml_elem_set_attribute_n - xmlAttr *attrp; - - DOMXML_NOT_IMPLEMENTED(); -- -+ - if ((ZEND_NUM_ARGS() == 1) && getParameters(ht, 1, &arg1) == SUCCESS) { - id = getThis(); - nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC); -@@ -2052,8 +2330,8 @@ PHP_FUNCTION(domxml_doc_doctype) - Returns DomeDOMImplementation */ - PHP_FUNCTION(domxml_doc_implementation) - { -- zval *id; -- xmlDocPtr docp; -+/* zval *id; -+ xmlDocPtr docp;*/ - - DOMXML_NOT_IMPLEMENTED(); - -@@ -2283,7 +2561,7 @@ PHP_FUNCTION(domxml_doc_create_processin - } - /* }}} */ - --/* {{{ proto object domxml_doc_imported_node(int node, bool recursive) -+/* {{{ proto object domxml_doc_imported_node(object node, bool recursive) - Creates new element node */ - PHP_FUNCTION(domxml_doc_imported_node) - { -@@ -2311,7 +2589,7 @@ PHP_FUNCTION(domxml_doc_imported_node) - } - /* }}} */ - --/* {{{ proto object domxml_dtd([int doc_handle]) -+/* {{{ proto object domxml_dtd(void) - Returns DTD of document */ - PHP_FUNCTION(domxml_intdtd) - { -@@ -2331,9 +2609,9 @@ PHP_FUNCTION(domxml_intdtd) - } - /* }}} */ - --/* {{{ proto string domxml_dumpmem([int doc_handle]) -+/* {{{ proto string domxml_dump_mem([object doc_handle]) - Dumps document into string */ --PHP_FUNCTION(domxml_dumpmem) -+PHP_FUNCTION(domxml_dump_mem) - { - zval *id; - xmlDoc *docp; -@@ -2341,7 +2619,6 @@ PHP_FUNCTION(domxml_dumpmem) - int size; - - DOMXML_PARAM_NONE(docp, id, le_domxmldocp); -- - xmlDocDumpMemory(docp, &mem, &size); - if (!size) { - RETURN_FALSE; -@@ -2350,6 +2627,73 @@ PHP_FUNCTION(domxml_dumpmem) - } - /* }}} */ - -+/* {{{ proto int domxml_dump_mem_file([object doc_handle],filename,compressmode) -+ Dumps document into file and uses compression if specified -+ Returns false on error, otherwise the length of the xml-document (uncompressed) -+ */ -+PHP_FUNCTION(domxml_dump_mem_file) -+{ -+ zval *id; -+ xmlDoc *docp; -+ int file_len, bytes; -+ int compressmode = 0; -+ char *file; -+ DOMXML_PARAM_THREE(docp, id, le_domxmldocp, "s|l", &file, &file_len, &compressmode); -+ -+ xmlSetCompressMode (compressmode); -+ bytes = xmlSaveFile(file,docp); -+ if (bytes == -1) -+ { -+ RETURN_FALSE; -+ } -+ RETURN_LONG(bytes); -+} -+/* }}} */ -+ -+/* {{{ proto string domxml_dump_node([object doc_handle],object node_handle[,int format[,int level]]) -+ Dumps node into string */ -+PHP_FUNCTION(domxml_dump_node) -+{ -+ zval *id, *nodep; -+ xmlDocPtr docp; -+ xmlNodePtr elementp; -+ xmlChar *mem ; -+ xmlBufferPtr buf; -+ int level = 0; -+ int format = 0; -+ -+ DOMXML_PARAM_THREE(docp, id, le_domxmldocp,"o|ll",&nodep,&format,&level); -+ -+ DOMXML_GET_OBJ(elementp, nodep, le_domxmlnodep); -+ -+ if (Z_TYPE_P(elementp) == XML_DOCUMENT_NODE || Z_TYPE_P(elementp) == XML_HTML_DOCUMENT_NODE ) { -+ php_error(E_WARNING, "%s(): cannot dump element with a document node", get_active_function_name(TSRMLS_C)); -+ RETURN_FALSE; -+ } -+ -+ buf = xmlBufferCreate(); -+ if (!buf) -+ { -+ php_error(E_WARNING, "%s(): could fetch buffer", get_active_function_name(TSRMLS_C)); -+ RETURN_FALSE; -+ } -+ -+ xmlNodeDump(buf, docp, elementp,level,format); -+ -+ mem = (xmlChar*) xmlBufferContent(buf); -+ -+ if (!mem) { -+ xmlBufferFree(buf); -+ RETURN_FALSE; -+ } -+ RETVAL_STRING(mem, 1); -+ -+ xmlBufferFree(buf); -+ -+} -+/* }}} */ -+ -+ - /* {{{ proto object xmldoc(string xmldoc [, bool from_file]) - Creates DOM object of XML document */ - PHP_FUNCTION(xmldoc) -@@ -2413,6 +2757,106 @@ PHP_FUNCTION(xmldocfile) - } - /* }}} */ - -+#if defined(LIBXML_HTML_ENABLED) -+/* {{{ proto string domxml_html_dump_mem([int doc_handle]) -+ Dumps document into string as HTML */ -+PHP_FUNCTION(domxml_html_dump_mem) -+{ -+ zval *id; -+ xmlDoc *docp; -+ xmlChar *mem; -+ int size; -+ -+ DOMXML_PARAM_NONE(docp, id, le_domxmldocp); -+ -+ htmlDocDumpMemory(docp, &mem, &size); -+ if (!size) { -+ RETURN_FALSE; -+ } -+ RETURN_STRINGL(mem, size, 1); -+} -+/* }}} */ -+ -+/* {{{ proto object html_doc(string html_doc [, bool from_file]) -+ Creates DOM object of HTML document */ -+PHP_FUNCTION(html_doc) -+{ -+ zval *rv; -+ xmlDoc *docp; -+ int ret; -+ char *buffer; -+ int buffer_len; -+ zend_bool from_file = 0; -+ -+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &buffer, &buffer_len, &from_file) == FAILURE) { -+ return; -+ } -+ -+ if (from_file) { -+ docp = htmlParseFile(buffer, NULL); -+ } else { -+ docp = htmlParseDoc(buffer, NULL); -+ } -+ if (!docp) -+ RETURN_FALSE; -+ -+ DOMXML_RET_OBJ(rv, (xmlNodePtr) docp, &ret); -+} -+/* }}} */ -+ -+/* {{{ proto object html_doc_file(string filename) -+ Creates DOM object of HTML document in file */ -+PHP_FUNCTION(html_doc_file) -+{ -+ zval *rv; -+ xmlDoc *docp; -+ int ret, file_len; -+ char *file; -+ -+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) { -+ return; -+ } -+ -+ docp = htmlParseFile(file, NULL); -+ if (!docp) { -+ RETURN_FALSE; -+ } -+ -+ DOMXML_RET_OBJ(rv, (xmlNodePtr) docp, &ret); -+ -+ add_property_resource(return_value, "doc", ret); -+ if (docp->name) -+ add_property_stringl(return_value, "name", (char *) docp->name, strlen(docp->name), 1); -+ if (docp->URL) -+ add_property_stringl(return_value, "url", (char *) docp->URL, strlen(docp->URL), 1); -+ if (docp->version) -+ add_property_stringl(return_value, "version", (char *) docp->version, strlen(docp->version), 1); -+/* add_property_stringl(return_value, "version", (char *) docp->version, strlen(docp->version), 1);*/ -+ if (docp->encoding) -+ add_property_stringl(return_value, "encoding", (char *) docp->encoding, strlen(docp->encoding), 1); -+ add_property_long(return_value, "standalone", docp->standalone); -+ add_property_long(return_value, "type", Z_TYPE_P(docp)); -+ add_property_long(return_value, "compression", docp->compression); -+ add_property_long(return_value, "charset", docp->charset); -+ zend_list_addref(ret); -+} -+/* }}} */ -+#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; -+ -+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &enable) == FAILURE) { -+ return; -+ } -+ -+ RETURN_BOOL(xmlSubstituteEntitiesDefault(enable)); -+} -+/* }}} */ -+ - /* {{{ proto bool domxml_node_text_concat(string content) - Add string tocontent of a node */ - PHP_FUNCTION(domxml_node_text_concat) -@@ -2421,7 +2865,7 @@ PHP_FUNCTION(domxml_node_text_concat) - xmlNode *nodep; - char *content; - int content_len; -- -+ - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &content, &content_len) == FAILURE) { -@@ -2589,7 +3033,7 @@ static int node_children(zval **children - - /* Get the namespace of the current node and add it as a property */ - /* XXX FIXME XXX */ --/* -+/* - if(!node_namespace(&namespace, last)) - zend_hash_update(Z_OBJPROP_P(child), "namespace", sizeof("namespace"), (void *) &namespace, sizeof(zval *), NULL); - */ -@@ -2619,7 +3063,7 @@ PHP_FUNCTION(xmltree) - xmlNode *root; - int ret, buf_len; - char *buf; -- -+ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) { - return; - } -@@ -2690,7 +3134,7 @@ static void php_xpathptr_new_context(INT - } - /* }}} */ - --/* {{{ proto string xpath_new_context([int doc_handle]) -+/* {{{ proto object xpath_new_context([int doc_handle]) - Creates new XPath context */ - PHP_FUNCTION(xpath_new_context) - { -@@ -2698,7 +3142,7 @@ PHP_FUNCTION(xpath_new_context) - } - /* }}} */ - --/* {{{ proto string xptr_new_context([int doc_handle]) -+/* {{{ proto object xptr_new_context([int doc_handle]) - Creates new XPath context */ - PHP_FUNCTION(xptr_new_context) - { -@@ -2731,10 +3175,10 @@ static void php_xpathptr_eval(INTERNAL_F - } - - ctxp = php_xpath_get_context(id, le_xpathctxp, 0 TSRMLS_CC); -- if (!ctxp) { -- php_error(E_WARNING, "%s() cannot fetch XPATH context", get_active_function_name(TSRMLS_C)); -- RETURN_FALSE; -- } -+ if (!ctxp) { -+ php_error(E_WARNING, "%s(): cannot fetch XPATH context", get_active_function_name(TSRMLS_C)); -+ RETURN_FALSE; -+ } - - if (contextnode) { - DOMXML_GET_OBJ(contextnodep, contextnode, le_domxmlnodep); -@@ -2761,7 +3205,7 @@ static void php_xpathptr_eval(INTERNAL_F - } - - if (NULL == (rv = php_xpathobject_new(xpathobjp, &ret TSRMLS_CC))) { -- php_error(E_WARNING, "%s() cannot create required XPATH objcet", get_active_function_name(TSRMLS_C)); -+ php_error(E_WARNING, "%s(): cannot create required XPATH objcet", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - SEPARATE_ZVAL(&rv); -@@ -2836,7 +3280,7 @@ static void php_xpathptr_eval(INTERNAL_F - } - /* }}} */ - --/* {{{ proto int xpath_eval([int xpathctx_handle,] string str) -+/* {{{ proto object xpath_eval([object xpathctx_handle,] string str) - Evaluates the XPath Location Path in the given string */ - PHP_FUNCTION(xpath_eval) - { -@@ -2844,13 +3288,46 @@ PHP_FUNCTION(xpath_eval) - } - /* }}} */ - --/* {{{ proto int xpath_eval_expression([int xpathctx_handle,] string str) -- Evaluates the XPath Location Path in the given string */ -+/* {{{ proto object xpath_eval_expression([object xpathctx_handle,] string str) -+ Evaluates the XPath expression in the given string */ - PHP_FUNCTION(xpath_eval_expression) - { - php_xpathptr_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_XPATH, 1); - } - /* }}} */ -+ -+/* {{{ proto bool xpath_register_ns([object xpathctx_handle,] string namespace_prefix, string namespace_uri) -+ Registeres the given namespace in the passed XPath context */ -+PHP_FUNCTION(xpath_register_ns) -+{ -+ /* -+ TODO: -+ - automagically register all namespaces when creating a new context -+ */ -+ -+ int prefix_len, uri_len, result; -+ xmlXPathContextPtr ctxp; -+ char *prefix, *uri, *uri_static; -+ zval *id; -+ -+ DOMXML_PARAM_FOUR(ctxp, id, le_xpathctxp, "ss", &prefix, &prefix_len, &uri, &uri_len); -+ -+ /* set the context node to NULL - what is a context node anyway? */ -+ ctxp->node = NULL; -+ -+ /* -+ this is a hack - libxml2 doesn't copy the URI, it simply uses the string -+ given in the parameter - which is normally deallocated after the function -+ */ -+ uri_static = estrndup(uri, uri_len); -+ result = xmlXPathRegisterNs(ctxp, prefix, uri_static); -+ -+ if (0 == result) { -+ RETURN_TRUE; -+ } -+ RETURN_FALSE; -+} -+/* }}} */ - #endif /* defined(LIBXML_XPATH_ENABLED) */ - - #if defined(LIBXML_XPTR_ENABLED) -@@ -2864,12 +3341,266 @@ PHP_FUNCTION(xptr_eval) - #endif /* LIBXML_XPTR_ENABLED */ - - /* {{{ proto string domxml_version(void) -- Dumps document into string */ -+ Get XML library version */ - PHP_FUNCTION(domxml_version) - { - RETURN_STRING(LIBXML_DOTTED_VERSION, 1); - } - /* }}} */ -+ -+#if HAVE_DOMXSLT -+static zval *php_xsltstylesheet_new(xsltStylesheetPtr obj, int *found TSRMLS_DC) -+{ -+ zval *wrapper; -+ int rsrc_type; -+ -+ if (! found) { -+ *found = 0; -+ } -+ -+ if (!obj) { -+ MAKE_STD_ZVAL(wrapper); -+ ZVAL_NULL(wrapper); -+ return wrapper; -+ } -+ -+ if ((wrapper = (zval *) dom_object_get_data((void *) obj))) { -+ zval_add_ref(&wrapper); -+ *found = 1; -+ return wrapper; -+ } -+ -+ MAKE_STD_ZVAL(wrapper); -+ -+ object_init_ex(wrapper, domxsltstylesheet_class_entry); -+ rsrc_type = le_domxsltstylesheetp; -+ php_xsltstylesheet_set_object(wrapper, (void *) obj, rsrc_type); -+ -+ return (wrapper); -+} -+ -+/* {{{ proto object domxml_xslt_stylesheet(string xsltstylesheet) -+ Creates XSLT Stylesheet object from string */ -+PHP_FUNCTION(domxml_xslt_stylesheet) -+{ -+ zval *rv; -+ xmlDocPtr docp; -+ xsltStylesheetPtr sheetp; -+ int ret; -+ char *buffer; -+ int buffer_len; -+ -+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buffer, &buffer_len) == FAILURE) { -+ RETURN_FALSE; -+ } -+ -+ docp = xmlParseDoc(buffer); -+ -+ if (!docp) -+ RETURN_FALSE; -+ -+ sheetp = xsltParseStylesheetDoc(docp); -+ -+ if (!sheetp) -+ RETURN_FALSE; -+ -+ rv = php_xsltstylesheet_new(sheetp, &ret TSRMLS_CC); -+ DOMXML_RET_ZVAL(rv); -+} -+/* }}} */ -+ -+/* {{{ proto object domxml_xslt_stylesheet_doc(object xmldoc) -+ Creates XSLT Stylesheet object from DOM Document object */ -+PHP_FUNCTION(domxml_xslt_stylesheet_doc) -+{ -+ zval *rv, *idxml; -+ xmlDocPtr docp; -+ xmlDocPtr newdocp; -+ xsltStylesheetPtr sheetp; -+ int ret; -+ -+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &idxml) == FAILURE) { -+ RETURN_FALSE; -+ } -+ -+ DOMXML_GET_OBJ(docp, idxml, le_domxmldocp); -+ -+ newdocp = xmlCopyDoc(docp, 1); -+ -+ if (!newdocp) -+ RETURN_FALSE; -+ -+ sheetp = xsltParseStylesheetDoc(newdocp); -+ -+ if (!sheetp) -+ RETURN_FALSE; -+ -+ rv = php_xsltstylesheet_new(sheetp, &ret TSRMLS_CC); -+ DOMXML_RET_ZVAL(rv); -+} -+/* }}} */ -+ -+/* {{{ proto object domxml_xslt_stylesheet_file(string filename) -+ Creates XSLT Stylesheet object from file */ -+PHP_FUNCTION(domxml_xslt_stylesheet_file) -+{ -+ zval *rv; -+ xsltStylesheetPtr sheetp; -+ int ret, file_len; -+ char *file; -+ -+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) { -+ RETURN_FALSE; -+ } -+ -+ sheetp = xsltParseStylesheetFile(file); -+ -+ if (!sheetp) -+ RETURN_FALSE; -+ -+ rv = php_xsltstylesheet_new(sheetp, &ret TSRMLS_CC); -+ DOMXML_RET_ZVAL(rv); -+} -+/* }}} */ -+ -+/* {{{ php_domxslt_string_to_xpathexpr() -+ Translates a string to a XPath Expression */ -+static char *php_domxslt_string_to_xpathexpr(const char *str) -+{ -+ const xmlChar *string = (const xmlChar *)str; -+ -+ xmlChar *value; -+ -+ TSRMLS_FETCH(); -+ -+ if (xmlStrchr(string, '"')) { -+ if (xmlStrchr(string, '\'')) { -+ php_error(E_WARNING, "Cannot create XPath expression (string contains both quote and double-quotes) in %s", -+ get_active_function_name(TSRMLS_C)); -+ return NULL; -+ } -+ value = xmlStrdup((const xmlChar *)"'"); -+ value = xmlStrcat(value, string); -+ value = xmlStrcat(value, (const xmlChar *)"'"); -+ } -+ else { -+ value = xmlStrdup((const xmlChar *)"\""); -+ value = xmlStrcat(value, string); -+ value = xmlStrcat(value, (const xmlChar *)"\""); -+ } -+ -+ return (char *)value; -+} -+ -+/* {{{ php_domxslt_make_params() -+ Translates a PHP array to a libxslt parameters array */ -+static char **php_domxslt_make_params(zval *idvars, int xpath_params) -+{ -+ HashTable *parht; -+ int parsize; -+ zval **value; -+ char *xpath_expr, *string_key = NULL; -+ ulong num_key; -+ char **params = NULL; -+ int i = 0; -+ -+ TSRMLS_FETCH(); -+ -+ parht = HASH_OF(idvars); -+ parsize = (2 * zend_hash_num_elements(parht) + 1) * sizeof(char *); -+ params = (char **)emalloc(parsize); -+ memset((char *)params, 0, parsize); -+ -+ for (zend_hash_internal_pointer_reset(parht); -+ zend_hash_get_current_data(parht, (void **)&value) == SUCCESS; -+ zend_hash_move_forward(parht)) { -+ -+ if (zend_hash_get_current_key(parht, &string_key, &num_key, 1) != HASH_KEY_IS_STRING) { -+ php_error(E_WARNING, "Invalid argument or parameter array to %s", -+ get_active_function_name(TSRMLS_C)); -+ return NULL; -+ } -+ else { -+ SEPARATE_ZVAL(value); -+ convert_to_string_ex(value); -+ -+ if (!xpath_params) { -+ xpath_expr = php_domxslt_string_to_xpathexpr(Z_STRVAL_PP(value)); -+ } -+ else { -+ xpath_expr = Z_STRVAL_PP(value); -+ } -+ -+ if (xpath_expr) { -+ params[i++] = string_key; -+ params[i++] = xpath_expr; -+ } -+ } -+ } -+ -+ params[i++] = NULL; -+ -+ return params; -+} -+ -+/* {{{ proto object domxml_xslt_process(object xslstylesheet, object xmldoc [, array xslt_parameters [, bool xpath_parameters]]) -+ Perform an XSLT transformation */ -+PHP_FUNCTION(domxml_xslt_process) -+{ -+/* TODO: -+ - test memory deallocation -+ - test other stuff -+ - check xsltsp->errors ??? -+*/ -+ zval *rv, *idxsl, *idxml, *idparams = NULL; -+ zend_bool xpath_params = 0; -+ xsltStylesheetPtr xsltstp; -+ xmlDocPtr xmldocp; -+ xmlDocPtr docp; -+ char **params = NULL; -+ int ret; -+ -+ DOMXML_GET_THIS(idxsl); -+ -+ xsltstp = php_xsltstylesheet_get_object(idxsl, le_domxsltstylesheetp, 0 TSRMLS_CC); -+ if (!xsltstp) { -+ php_error(E_WARNING, "%s(): underlying object missing", -+ get_active_function_name(TSRMLS_C)); -+ RETURN_FALSE; -+ } -+ -+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|ab", &idxml, &idparams, &xpath_params) == FAILURE) { -+ RETURN_FALSE; -+ } -+ -+ DOMXML_GET_OBJ(xmldocp, idxml, le_domxmldocp); -+ -+ if (idparams) { -+ params = php_domxslt_make_params(idparams, xpath_params); -+ } -+ -+ docp = xsltApplyStylesheet(xsltstp, xmldocp, (const char**)params); -+ -+ if (params) { -+ efree(params); -+ } -+ -+ if (!docp) { -+ RETURN_FALSE; -+ } -+ -+ DOMXML_RET_OBJ(rv, (xmlNodePtr) docp, &ret); -+} -+/* }}} */ -+ -+/* {{{ proto string domxml_xslt_version(void) -+ Get XSLT library version */ -+PHP_FUNCTION(domxml_xslt_version) -+{ -+ RETURN_STRING(LIBXSLT_DOTTED_VERSION, 1); -+} -+/* }}} */ -+#endif /* HAVE_DOMXSLT */ - - #endif /* HAVE_DOMXML */ - -diff -upr php-4.1.2/ext/domxml/php_domxml.h php-4.1.2-dom-xslt/ext/domxml/php_domxml.h ---- php-4.1.2/ext/domxml/php_domxml.h Fri Dec 14 11:45:46 2001 -+++ php-4.1.2-dom-xslt/ext/domxml/php_domxml.h Tue Jan 22 00:21:32 2002 -@@ -16,19 +16,36 @@ - +----------------------------------------------------------------------+ - */ - --/* $Id$ */ -+/* $Id$ */ - - #ifndef PHP_DOMXML_H - #define PHP_DOMXML_H - - #if HAVE_DOMXML - #include -+#include -+#include -+#if defined(LIBXML_HTML_ENABLED) -+#include -+#include -+#endif - #if defined(LIBXML_XPATH_ENABLED) - #include -+#include - #endif - #if defined(LIBXML_XPTR_ENABLED) - #include - #endif -+#if HAVE_DOMXSLT -+#include -+#include -+#include -+#include -+#if HAVE_DOMEXSLT -+#include -+#include -+#endif -+#endif - - extern zend_module_entry domxml_module_entry; - #define domxml_module_ptr &domxml_module_entry -@@ -40,8 +57,13 @@ PHP_MINFO_FUNCTION(domxml); - PHP_FUNCTION(domxml_version); - PHP_FUNCTION(xmldoc); - PHP_FUNCTION(xmldocfile); -+#if defined(LIBXML_HTML_ENABLED) -+PHP_FUNCTION(html_doc); -+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); -@@ -57,7 +79,13 @@ PHP_FUNCTION(domxml_doc_create_entity_re - PHP_FUNCTION(domxml_doc_imported_node); - PHP_FUNCTION(domxml_add_root); - PHP_FUNCTION(domxml_intdtd); --PHP_FUNCTION(domxml_dumpmem); -+PHP_FUNCTION(domxml_dump_mem); -+PHP_FUNCTION(domxml_dump_mem_file); -+PHP_FUNCTION(domxml_dump_node); -+ -+#if defined(LIBXML_HTML_ENABLED) -+PHP_FUNCTION(domxml_html_dump_mem); -+#endif - - /* Class DocumentType methods */ - PHP_FUNCTION(domxml_doctype_name); -@@ -89,8 +117,10 @@ PHP_FUNCTION(domxml_node_prefix); - PHP_FUNCTION(domxml_node); - PHP_FUNCTION(domxml_clone_node); - PHP_FUNCTION(domxml_node_unlink_node); -+PHP_FUNCTION(domxml_node_replace_node); - PHP_FUNCTION(domxml_node_new_child); - PHP_FUNCTION(domxml_node_set_content); -+PHP_FUNCTION(domxml_node_get_content); - PHP_FUNCTION(domxml_node_text_concat); - PHP_FUNCTION(domxml_node_set_name); - PHP_FUNCTION(domxml_node_name); -@@ -135,12 +165,22 @@ PHP_FUNCTION(xpath_init); - PHP_FUNCTION(xpath_new_context); - PHP_FUNCTION(xpath_eval); - PHP_FUNCTION(xpath_eval_expression); -+PHP_FUNCTION(xpath_register_ns); - #endif - #if defined(LIBXML_XPTR_ENABLED) - PHP_FUNCTION(xptr_new_context); - PHP_FUNCTION(xptr_eval); - #endif - PHP_FUNCTION(domxml_test); -+ -+/* DOMXSLT functions */ -+#if HAVE_DOMXSLT -+PHP_FUNCTION(domxml_xslt_stylesheet); -+PHP_FUNCTION(domxml_xslt_stylesheet_doc); -+PHP_FUNCTION(domxml_xslt_stylesheet_file); -+PHP_FUNCTION(domxml_xslt_process); -+PHP_FUNCTION(domxml_xslt_version); -+#endif - - #else - #define domxml_module_ptr NULL diff --git a/php-ZVAL.patch b/php-ZVAL.patch deleted file mode 100644 index 8a4a331..0000000 --- a/php-ZVAL.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -u -r1.87 zend_API.h ---- php-4.0.6.orig/Zend/zend_API.h 2001/04/19 17:51:23 -+++ php-4.0.6/Zend/zend_API.h 2001/08/24 13:18:51 -@@ -268,8 +268,8 @@ - (z)->type = IS_STRING; \ - } - --#define ZVAL_FALSE { (z)->value.lval = 0; (z)->type = IS_BOOL; } --#define ZVAL_TRUE { (z)->value.lval = 1; (z)->type = IS_BOOL; } -+#define ZVAL_FALSE(z) { (z)->value.lval = 0; (z)->type = IS_BOOL; } -+#define ZVAL_TRUE(z) { (z)->value.lval = 1; (z)->type = IS_BOOL; } - - #define RETVAL_RESOURCE(l) { \ - return_value->type = IS_RESOURCE;\ diff --git a/php-ac250.patch b/php-ac250.patch deleted file mode 100644 index 68411c5..0000000 --- a/php-ac250.patch +++ /dev/null @@ -1,248 +0,0 @@ ---- php-4.0.6/ext/pdf/config.m4.wiget Thu Jun 14 06:35:44 2001 -+++ php-4.0.6/ext/pdf/config.m4 Fri Jul 6 08:37:53 2001 -@@ -18,7 +18,7 @@ - AC_CHECK_LIB(pdf, PDF_show_boxed, [ - AC_DEFINE(HAVE_PDFLIB,1,[ ]) - ],[ -- AC_MSG_ERROR(pdflib extension requires at least pdflib 3.x. You may also need libtiff and libjpeg. If so, use the options --with-tiff-dir= and --with-jpeg-dir=) -+ AC_MSG_ERROR([pdflib extension requires at least pdflib 3.x. You may also need libtiff and libjpeg. If so, use the options --with-tiff-dir= and --with-jpeg-dir=]) - ],[ - -ltiff -ljpeg -lpng -lz - ]) -@@ -34,7 +34,7 @@ - if test -n "$PDFLIB_INCLUDE" ; then - - if test "$PHP_ZLIB_DIR" = "no"; then -- AC_MSG_ERROR(PDF extension requires ZLIB. Use --with-zlib-dir=) -+ AC_MSG_ERROR([PDF extension requires ZLIB. Use --with-zlib-dir=]) - fi - - PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, PDFLIB_SHARED_LIBADD) -@@ -47,7 +47,7 @@ - [ - PHP_ADD_LIBRARY_WITH_PATH(jpeg, $PHP_JPEG_DIR/lib, PDFLIB_SHARED_LIBADD) - ],[ -- AC_MSG_ERROR(libjpeg not found!) -+ AC_MSG_ERROR([libjpeg not found!]) - ],[ - -L$PHP_JPEG_DIR/lib - ]) -@@ -56,12 +56,12 @@ - [ - PHP_ADD_LIBRARY(jpeg,, PDFLIB_SHARED_LIBADD) - ],[ -- AC_MSG_RESULT(no, try --with-jpeg-dir=) -+ AC_MSG_RESULT([no, try --with-jpeg-dir=]) - ]) - fi - - -- PHP_ARG_WITH(png-dir, for the location of libpng, -+ PHP_ARG_WITH(png-dir,[ for the location of libpng], - [ --with-png-dir[=DIR] PDFLIB: define libpng install directory]) - - if test "$PHP_PNG_DIR" != "no"; then -@@ -69,7 +69,7 @@ - [ - PHP_ADD_LIBRARY_WITH_PATH(png, $PHP_PNG_DIR/lib, PDFLIB_SHARED_LIBADD) - ],[ -- AC_MSG_ERROR(libpng not found!) -+ AC_MSG_ERROR([libpng not found!]) - ],[ - -L$PHP_PNG_DIR/lib - ]) -@@ -78,12 +78,12 @@ - [ - PHP_ADD_LIBRARY(png,, PDFLIB_SHARED_LIBADD) - ],[ -- AC_MSG_RESULT(no, try --with-png-dir=) -+ AC_MSG_RESULT([no, try --with-png-dir=]) - ]) - fi - - -- PHP_ARG_WITH(tiff-dir, for the location of libtiff, -+ PHP_ARG_WITH(tiff-dir,[ for the location of libtiff], - [ --with-tiff-dir[=DIR] PDFLIB: define libtiff install directory]) - - if test "$PHP_TIFF_DIR" != "no"; then -@@ -91,7 +91,7 @@ - [ - PHP_ADD_LIBRARY_WITH_PATH(tiff, $PHP_TIFF_DIR/lib, PDFLIB_SHARED_LIBADD) - ],[ -- AC_MSG_ERROR(libtiff not found!) -+ AC_MSG_ERROR([libtiff not found!]) - ],[ - -L$PHP_TIFF_DIR/lib - ]) -@@ -100,7 +100,7 @@ - [ - PHP_ADD_LIBRARY(tiff,, PDFLIB_SHARED_LIBADD) - ],[ -- AC_MSG_RESULT(no, Try --with-tiff-dir=) -+ AC_MSG_RESULT([no, Try --with-tiff-dir=]) - ]) - fi - -@@ -111,7 +111,7 @@ - PHP_ADD_LIBRARY_WITH_PATH(pdf, $PHP_PDFLIB/lib, PDFLIB_SHARED_LIBADD) - PHP_ADD_INCLUDE($PDFLIB_INCLUDE) - ],[ -- AC_MSG_ERROR(pdflib extension requires at least pdflib 3.x.) -+ AC_MSG_ERROR([pdflib extension requires at least pdflib 3.x.]) - ],[ - -L$PHP_PDFLIB/lib - ]) ---- php-4.0.6/ext/yp/config.m4.wiget Fri Jul 6 08:37:53 2001 -+++ php-4.0.6/ext/yp/config.m4 Fri Jul 6 08:37:53 2001 -@@ -2,13 +2,15 @@ - dnl config.m4 for extension yp - dnl don't forget to call PHP_EXTENSION(yp) - --PHP_ARG_ENABLE(yp,whether to include YP support, -+PHP_ARG_ENABLE(yp,[whether to include YP support], - [ --enable-yp Include YP support]) - - if test "$PHP_YP" != "no"; then - PHP_SUBST(NSL_SHARED_LIBADD) -- AC_ADD_LIBRARY_WITH_PATH(nsl, /usr/lib, NSL_SHARED_LIBADD) -- AC_CHECK_LIB(nsl, yp_match, [AC_DEFINE(HAVE_YP,1,[ ])], [AC_MSG_ERROR(YP module requires libnsl)],) -+ AC_CHECK_LIB(nsl, yp_match, [ -+ AC_DEFINE(HAVE_YP,1,[ ]) -+ PHP_ADD_LIBRARY(nsl,, NSL_SHARED_LIBADD) -+ ], [AC_MSG_ERROR([YP module requires libnsl])]) - PHP_EXTENSION(yp, $ext_shared) - - case "$host_alias" in ---- php-4.1.1/acinclude.m4.wiget Sun Jun 10 21:52:56 2001 -+++ php-4.1.1/acinclude.m4 Fri Jul 6 09:26:10 2001 -@@ -351,7 +351,7 @@ - AC_SUBST($1) - ]) - --AC_DEFUN(PHP_FAST_OUTPUT,[ -+AC_DEFUN([PHP_FAST_OUTPUT],[ - PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $1" - ]) - -@@ -377,7 +377,7 @@ - done - ]) - --AC_DEFUN(PHP_GEN_MAKEFILES,[ -+AC_DEFUN([PHP_GEN_MAKEFILES],[ - $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $1 - ]) - -@@ -914,6 +908,7 @@ - dnl ## This macro can be used several times. - AC_DEFUN(PHP_OUTPUT,[ - PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1" -+ AC_CONFIG_FILES($1) - ]) - - AC_DEFUN(PHP_DECLARED_TIMEZONE,[ ---- php-4.0.6/configure.in.wiget Fri Jul 6 08:37:53 2001 -+++ php-4.0.6/configure.in Fri Jul 6 09:32:15 2001 -@@ -5,7 +5,7 @@ - - AC_INIT(README.CVS-RULES) - --PHP_FAST_OUTPUT(sapi/Makefile ext/Makefile Makefile pear/Makefile main/Makefile) -+PHP_FAST_OUTPUT([sapi/Makefile ext/Makefile Makefile pear/Makefile main/Makefile]) - - if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then - AC_MSG_ERROR(--with-shared-apache is not supported. Please refer to the documentation for using APXS) -@@ -117,10 +117,7 @@ - AC_PROG_CC_C_O - AC_PROG_LN_S - --AM_PROG_LEX --if test -n "$LEX"; then -- AC_DECL_YYTEXT --fi -+AC_PROG_LEX() - - dnl ## Make flex scanners use const if they can, even if __STDC__ is not - dnl ## true, for compilers like Sun's that only set __STDC__ true in -@@ -225,12 +222,12 @@ - - unset ac_cv_func_yp_get_default_domain - AC_CHECK_FUNC(yp_get_default_domain, -- [php_no_nsl_checks=yes],[ ]) -+ [php_no_nsl_checks=yes],[true ]) - unset ac_cv_func_yp_get_default_domain - - if test "$php_no_nsl_checks" != "yes"; then - --AC_CHECK_FUNC(gethostname, [ ], [ -+AC_CHECK_FUNC(gethostname, [true ], [ - AC_CHECK_LIB(nsl, gethostname, [ - PHP_ADD_LIBRARY(nsl) - AC_DEFINE(HAVE_LIBNSL,1,[ ]) ],[ -@@ -250,8 +247,8 @@ - - dnl Only include libbind if inet_aton is not found in - dnl libresolv. --AC_CHECK_LIB(resolv, inet_aton, [], [ -- AC_CHECK_LIB(bind, inet_aton, [], [ -+AC_CHECK_LIB(resolv, inet_aton, [true], [ -+ AC_CHECK_LIB(bind, inet_aton, [true], [ - AC_CHECK_LIB(bind, __inet_aton) - ]) - ]) -@@ -870,6 +867,12 @@ - PHP_SUBST(TSRM_LIB) - PHP_SUBST(WARNING_LEVEL) - PHP_SUBST_OLD(YACC) -+PHP_SUBST(EXT_SUBDIRS) -+PHP_SUBST(EXT_STATIC) -+PHP_SUBST(EXT_SHARED) -+PHP_SUBST(EXT_LIBS) -+PHP_SUBST(EXT_LTLIBS) -+ - - PHP_CONFIGURE_PART(Configuring libtool) - -@@ -936,14 +939,17 @@ - pear/scripts/pear pear/scripts/phpize pear/scripts/php-config \ - TSRM/Makefile $PHP_OUTPUT_FILES" - --AC_OUTPUT($ALL_OUTPUT_FILES, [], [ -+AC_CONFIG_FILES([php4.spec Zend/Makefile main/build-defs.h -+ pear/scripts/pear pear/scripts/phpize pear/scripts/php-config -+ TSRM/Makefile]) -+AC_CONFIG_COMMANDS([default], [true], [ - --if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES"; then -+dnl if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES"; then - REDO_ALL=yes --fi -+dnl fi - - if test -n "\$REDO_ALL"; then -- PHP_GEN_MAKEFILES($PHP_FAST_OUTPUT_FILES) -+ PHP_GEN_MAKEFILES([$PHP_FAST_OUTPUT_FILES]) - fi - - if test ! -f $srcdir/ext/bcmath/number.c; then -@@ -1057,6 +1063,8 @@ - fi - ]) - -+AC_OUTPUT -+ - dnl ## Local Variables: - dnl ## tab-width: 4 - dnl ## End: ---- php-4.1.1/ext/imap/config.m4.orig Tue Aug 7 18:18:04 2001 -+++ php-4.1.1/ext/imap/config.m4 Sat Jan 19 13:50:24 2002 -@@ -133,7 +133,7 @@ - #endif - ],[ - AC_DEFINE(HAVE_IMAP2001, 1, [ ]) -- ],[ ]) -+ ],[:]) - CPPFLAGS=$old_CPPFLAGS - - AC_CHECK_LIB(pam, pam_start) diff --git a/php-am_ac_lt.patch b/php-am_ac_lt.patch deleted file mode 100644 index 992d8c9..0000000 --- a/php-am_ac_lt.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -urN php-4.1.2.org/TSRM/threads.m4 php-4.1.2/TSRM/threads.m4 ---- php-4.1.2.org/TSRM/threads.m4 Mon Apr 8 01:42:39 2002 -+++ php-4.1.2/TSRM/threads.m4 Mon Apr 8 01:43:36 2002 -@@ -32,7 +32,11 @@ - dnl - AC_DEFUN(PTHREADS_FLAGS,[ - if test -z "$host_alias"; then -- AC_MSG_ERROR(host_alias is not set. Make sure to run config.guess) -+ if test -z "$build_alias"; then -+ AC_MSG_ERROR(host_alias is not set. Make sure to run config.guess) -+ else -+ host_alias=$build_alias -+ fi - fi - case "$host_alias" in - *solaris*) -diff -urN php-4.1.2.org/configure.in php-4.1.2/configure.in ---- php-4.1.2.org/configure.in Mon Apr 8 01:42:39 2002 -+++ php-4.1.2/configure.in Mon Apr 8 01:42:57 2002 -@@ -115,11 +115,11 @@ - - AM_PROG_CC_STDC - --AC_PROG_RANLIB -+AC_PROG_LIBTOOL - AC_PROG_CC_C_O - AC_PROG_LN_S - --AC_PROG_LEX -+AM_PROG_LEX - if test -n "$LEX"; then - AC_DECL_YYTEXT - fi diff --git a/php-apache2.patch b/php-apache2.patch deleted file mode 100644 index 0c6aba3..0000000 --- a/php-apache2.patch +++ /dev/null @@ -1,310 +0,0 @@ -diff -urN php-4.1.2.org/sapi/apache2filter/apache_config.c php-4.1.2/sapi/apache2filter/apache_config.c ---- php-4.1.2.org/sapi/apache2filter/apache_config.c Mon Apr 8 02:40:24 2002 -+++ php-4.1.2/sapi/apache2filter/apache_config.c Wed Feb 28 15:11:34 2001 -@@ -88,7 +88,7 @@ - php_dir_entry *pe; - php_dir_entry *data; - char *str; -- uint str_len; -+ ulong str_len; - ulong num_index; - - phpapdebug((stderr, "Merge dir (%p) (%p)\n", base_conf, new_conf)); -@@ -110,7 +110,7 @@ - { - php_conf_rec *d = dummy; - char *str; -- uint str_len; -+ ulong str_len; - php_dir_entry *data; - - for (zend_hash_internal_pointer_reset(&d->config); -diff -urN php-4.1.2.org/sapi/apache2filter/php_apache.h php-4.1.2/sapi/apache2filter/php_apache.h ---- php-4.1.2.org/sapi/apache2filter/php_apache.h Mon Apr 8 02:40:24 2002 -+++ php-4.1.2/sapi/apache2filter/php_apache.h Mon Apr 8 02:34:03 2002 -@@ -1,8 +1,8 @@ - /* - +----------------------------------------------------------------------+ -- | PHP version 4.0 | -+ | PHP Version 4 | - +----------------------------------------------------------------------+ -- | Copyright (c) 1997-2001 The PHP Group | -+ | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | -@@ -12,7 +12,7 @@ - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ -- | Authors: Sascha Schumann | -+ | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -diff -urN php-4.1.2.org/sapi/apache2filter/php_functions.c php-4.1.2/sapi/apache2filter/php_functions.c ---- php-4.1.2.org/sapi/apache2filter/php_functions.c Mon Apr 8 02:40:24 2002 -+++ php-4.1.2/sapi/apache2filter/php_functions.c Mon Apr 8 02:39:31 2002 -@@ -38,6 +38,7 @@ - { - zval **p1; - php_struct *ctx; -+ SLS_FETCH(); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &p1) == FAILURE) - return NULL; -@@ -109,6 +110,7 @@ - php_struct *ctx; - apr_array_header_t *arr; - char *key, *val; -+ SLS_FETCH(); - - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; -@@ -135,7 +137,7 @@ - }; - - static zend_module_entry php_apache_module = { -- STANDARD_MODULE_HEADER, -+ STANDARD_MODULE_HEADER, - "Apache 2.0", - apache_functions, - NULL, -diff -urN php-4.1.2.org/sapi/apache2filter/sapi_apache2.c php-4.1.2/sapi/apache2filter/sapi_apache2.c ---- php-4.1.2.org/sapi/apache2filter/sapi_apache2.c Mon Apr 8 02:40:24 2002 -+++ php-4.1.2/sapi/apache2filter/sapi_apache2.c Mon Apr 8 02:30:57 2002 -@@ -1,8 +1,8 @@ - /* - +----------------------------------------------------------------------+ -- | PHP version 4.0 | -+ | PHP Version 4 | - +----------------------------------------------------------------------+ -- | Copyright (c) 1997-2001 The PHP Group | -+ | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | -@@ -48,6 +48,7 @@ - { - apr_bucket *b; - apr_bucket_brigade *bb; -+ apr_bucket_alloc_t *ba; - php_struct *ctx; - uint now; - -@@ -55,10 +56,11 @@ - - if (str_length == 0) return 0; - -- bb = apr_brigade_create(ctx->f->r->pool); -+ ba = ctx->f->r->connection->bucket_alloc; -+ bb = apr_brigade_create(ctx->f->r->pool, ba); - while (str_length > 0) { - now = MIN(str_length, 4096); -- b = apr_bucket_transient_create(str, now); -+ b = apr_bucket_transient_create(str, now, ba); - APR_BRIGADE_INSERT_TAIL(bb, b); - str += now; - str_length -= now; -@@ -145,7 +147,7 @@ - php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC) - { - php_struct *ctx = SG(server_context); -- apr_array_header_t *arr = apr_table_elts(ctx->f->r->subprocess_env); -+ const apr_array_header_t *arr = apr_table_elts(ctx->f->r->subprocess_env); - char *key, *val; - - APR_ARRAY_FOREACH_OPEN(arr, key, val) -@@ -161,15 +163,20 @@ - { - php_struct *ctx = server_context; - apr_bucket_brigade *bb; -+ apr_bucket_alloc_t *ba; - apr_bucket *b; - -+ if (!server_context) -+ return; -+ - /* Send a flush bucket down the filter chain. The current default - * handler seems to act on the first flush bucket, but ignores - * all further flush buckets. - */ - -- bb = apr_brigade_create(ctx->f->r->pool); -- b = apr_bucket_flush_create(); -+ ba = ctx->f->r->connection->bucket_alloc; -+ bb = apr_brigade_create(ctx->f->r->pool, ba); -+ b = apr_bucket_flush_create(ba); - APR_BRIGADE_INSERT_TAIL(bb, b); - if (ap_pass_brigade(ctx->f->next, bb) != APR_SUCCESS) { - php_handle_aborted_connection(); -@@ -182,8 +189,13 @@ - TSRMLS_FETCH(); - - ctx = SG(server_context); -- -- apr_file_puts(msg, ctx->f->r->server->error_log); -+ -+ /* We use APLOG_STARTUP because it keeps us from printing the -+ * data and time information at the beginning of the error log -+ * line. Not sure if this is correct, but it mirrors what happens -+ * with Apache 1.3 -- rbb -+ */ -+ ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO | APLOG_STARTUP, 0, ctx->f->r->server, "%s", msg); - } - - static sapi_module_struct apache2_sapi_module = { -@@ -226,11 +238,11 @@ - if (ctx == NULL) { \ - /* Initialize filter context */ \ - SG(server_context) = ctx = apr_pcalloc(f->r->pool, sizeof(*ctx)); \ -- ctx->bb = apr_brigade_create(f->c->pool); \ -+ ctx->bb = apr_brigade_create(f->c->pool, f->c->bucket_alloc); \ - } - - static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb, -- ap_input_mode_t mode, apr_size_t *readbytes) -+ ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) - { - php_struct *ctx; - long old_index; -@@ -240,11 +252,15 @@ - apr_status_t rv; - TSRMLS_FETCH(); - -+ if (f->r->proxyreq) { -+ return ap_get_brigade(f->next, bb, mode, block, readbytes); -+ } -+ - ctx = SG(server_context); - - INIT_CTX; - -- if ((rv = ap_get_brigade(f->next, bb, mode, readbytes)) != APR_SUCCESS) { -+ if ((rv = ap_get_brigade(f->next, bb, mode, block, readbytes)) != APR_SUCCESS) { - return rv; - } - -@@ -307,6 +323,14 @@ - void *conf = ap_get_module_config(f->r->per_dir_config, &php4_module); - TSRMLS_FETCH(); - -+ if (f->r->proxyreq) { -+ return ap_pass_brigade(f->next, bb); -+ } -+ -+ /* setup standard CGI variables */ -+ ap_add_common_vars(f->r); -+ ap_add_cgi_vars(f->r); -+ - ctx = SG(server_context); - INIT_CTX; - -@@ -361,9 +385,9 @@ - php_execute_script(&zfd TSRMLS_CC); - } else { - --#define NO_DATA "The PHP Filter did not receive suitable input data" -+#define PHP_NO_DATA "The PHP Filter did not receive suitable input data" - -- eos = apr_bucket_transient_create(NO_DATA, sizeof(NO_DATA)-1); -+ eos = apr_bucket_transient_create(PHP_NO_DATA, sizeof(PHP_NO_DATA)-1, f->c->bucket_alloc); - APR_BRIGADE_INSERT_HEAD(bb, eos); - } - } -@@ -372,7 +396,7 @@ - - SG(server_context) = 0; - /* Pass EOS bucket to next filter to signal end of request */ -- eos = apr_bucket_eos_create(); -+ eos = apr_bucket_eos_create(f->c->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(bb, eos); - - return ap_pass_brigade(f->next, bb); -@@ -391,21 +415,67 @@ - return APR_SUCCESS; - } - --static void --php_apache_server_startup(apr_pool_t *pchild, server_rec *s) -+static void php_apache_add_version(apr_pool_t *p) -+{ -+ TSRMLS_FETCH(); -+ if (PG(expose_php)) { -+ ap_add_version_component(p, "PHP/" PHP_VERSION); -+ } -+} -+ -+static int -+php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, -+ apr_pool_t *ptemp, server_rec *s) - { - tsrm_startup(1, 1, 0, NULL); - sapi_startup(&apache2_sapi_module); - apache2_sapi_module.startup(&apache2_sapi_module); -- apr_pool_cleanup_register(pchild, NULL, php_apache_server_shutdown, NULL); -+ apr_pool_cleanup_register(pconf, NULL, php_apache_server_shutdown, apr_pool_cleanup_null); - php_apache_register_module(); -+ php_apache_add_version(pconf); -+ -+ return OK; -+} -+ -+static void php_add_filter(request_rec *r, ap_filter_t *f) -+{ -+ int output = (f == r->output_filters); -+ -+ /* for those who still have Set*Filter PHP configured */ -+ while (f) { -+ if (strcmp(f->frec->name, "PHP") == 0) { -+ ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, -+ 0, r->server, -+ "\"Set%sFilter PHP\" already configured for %s", -+ output ? "Output" : "Input", r->uri); -+ return; -+ } -+ f = f->next; -+ } -+ -+ if (output) { -+ ap_add_output_filter("PHP", NULL, r, r->connection); -+ } -+ else { -+ ap_add_input_filter("PHP", NULL, r, r->connection); -+ } -+} -+ -+static void php_insert_filter(request_rec *r) -+{ -+ if (r->content_type && -+ strcmp(r->content_type, "application/x-httpd-php") == 0) { -+ php_add_filter(r, r->output_filters); -+ php_add_filter(r, r->input_filters); -+ } - } - - static void php_register_hook(apr_pool_t *p) - { -- ap_hook_child_init(php_apache_server_startup, NULL, NULL, APR_HOOK_MIDDLE); -- ap_register_output_filter("PHP", php_output_filter, AP_FTYPE_CONTENT); -- ap_register_input_filter("PHP", php_input_filter, AP_FTYPE_CONTENT); -+ ap_hook_post_config(php_apache_server_startup, NULL, NULL, APR_HOOK_MIDDLE); -+ ap_hook_insert_filter(php_insert_filter, NULL, NULL, APR_HOOK_MIDDLE); -+ ap_register_output_filter("PHP", php_output_filter, AP_FTYPE_RESOURCE); -+ ap_register_input_filter("PHP", php_input_filter, AP_FTYPE_RESOURCE); - } - - AP_MODULE_DECLARE_DATA module php4_module = { -@@ -417,3 +487,12 @@ - php_dir_cmds, /* command apr_table_t */ - php_register_hook /* register hooks */ - }; -+ -+/* -+ * Local variables: -+ * tab-width: 4 -+ * c-basic-offset: 4 -+ * End: -+ * vim600: sw=4 ts=4 fdm=marker -+ * vim<600: sw=4 ts=4 -+ */ diff --git a/php-domxml_node.patch b/php-domxml_node.patch deleted file mode 100644 index 8a28a8d..0000000 --- a/php-domxml_node.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- php-4.1.1/ext/domxml/php_domxml.c~ Thu Feb 14 15:23:48 2002 -+++ php-4.1.1/ext/domxml/php_domxml.c Thu Feb 14 15:23:48 2002 -@@ -833,6 +833,7 @@ - if (Z_TYPE_P(obj) == XML_ENTITY_REF_NODE) { - content = xmlNodeGetContent(nodep); - if (content) -+ add_property_long(wrapper, "type", Z_TYPE_P(nodep)); - add_property_stringl(wrapper, "content", (char *) content, strlen(content), 1); - } - break; diff --git a/php-image_c.patch b/php-image_c.patch deleted file mode 100644 index ee6215f..0000000 --- a/php-image_c.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- php-4.1.1/ext/standard/image.c~ Thu Feb 14 15:40:36 2002 -+++ php-4.1.1/ext/standard/image.c Thu Feb 14 15:40:36 2002 -@@ -323,7 +323,9 @@ - unsigned int marker; - char tmp[2]; - unsigned char a[4]; -- -+ unsigned short skip; -+ unsigned char *buffer; -+ - for (;;) { - marker = php_next_marker(socketd, fp, issock); - switch (marker) { -@@ -349,7 +351,12 @@ - result->height = (((unsigned short) a[ 0 ]) << 8) + ((unsigned short) a[ 1 ]); - result->width = (((unsigned short) a[ 2 ]) << 8) + ((unsigned short) a[ 3 ]); - result->channels = FP_FGETC(socketd, fp, issock); -- -+ /* skip component specification parameters */ -+ skip = result-> channels *3; -+ buffer = emalloc(skip); -+ FP_FREAD(buffer, (long) skip, socketd, fp, issock); -+ efree(buffer); -+ - if (! info) /* if we don't want an extanded info -> return */ - return result; - } else { diff --git a/php-imap.patch b/php-imap.patch deleted file mode 100644 index 9cfe802..0000000 --- a/php-imap.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- php-4.0.6/ext/imap/config.m4.imap Wed Jul 11 09:21:00 2001 -+++ php-4.0.6/ext/imap/config.m4 Wed Jul 11 09:28:24 2001 -@@ -49,14 +49,11 @@ - - if test "$PHP_IMAP_SSL" != "no"; then - PHP_ADD_LIBPATH($PHP_IMAP_SSL/lib, IMAP_SHARED_LIBADD) -- PHP_ADD_LIBRARY_DEFER(crypto) -- PHP_ADD_LIBRARY_DEFER(ssl) -+ PHP_ADD_LIBRARY(crypto, 1, IMAP_SHARED_LIBADD) -+ PHP_ADD_LIBRARY(ssl, 1, IMAP_SHARED_LIBADD) - - old_LIBS=$LIBS -- LIBS="$LIBS -lc-client" -- if test $PHP_KERBEROS != "no"; then -- LIBS="$LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" -- fi -+ LIBS="$LIBS $IMAP_SHARED_LIBADD" - AC_TRY_RUN([ - void mm_log(void){} - void mm_dlog(void){} -@@ -133,8 +130,7 @@ - fi - - PHP_ADD_INCLUDE($IMAP_INC_DIR) -- PHP_ADD_LIBPATH($IMAP_LIBDIR, IMAP_SHARED_LIBADD) -- PHP_ADD_LIBRARY_DEFER($IMAP_LIB) -+ PHP_ADD_LIBRARY_WITH_PATH($IMAP_LIB, $IMAP_LIBDIR, IMAP_SHARED_LIBADD) - PHP_IMAP_KRB_CHK - PHP_IMAP_SSL_CHK - fi diff --git a/php-libxml2.patch b/php-libxml2.patch deleted file mode 100644 index 73840e4..0000000 --- a/php-libxml2.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- php-4.0.6/ext/domxml/config.m4~ Thu Nov 15 00:32:45 2001 -+++ php-4.0.6/ext/domxml/config.m4 Thu Nov 15 00:32:45 2001 -@@ -3,7 +3,7 @@ - - AC_DEFUN(PHP_DOM_CHECK_VERSION,[ - old_CPPFLAGS=$CPPFLAGS -- CPPFLAGS=-I$DOMXML_DIR/include -+ CPPFLAGS=-I$DOMXML_DIR/include/libxml2 - AC_MSG_CHECKING(for libxml version) - AC_EGREP_CPP(yes,[ - #include -@@ -25,12 +25,12 @@ - - if test "$PHP_DOM" != "no"; then - -- if test -r $PHP_DOM/include/libxml/tree.h; then -+ if test -r $PHP_DOM/include/libxml2/libxml/tree.h; then - DOMXML_DIR=$PHP_DOM - else - AC_MSG_CHECKING(for DOM in default path) - for i in /usr/local /usr; do -- if test -r $i/include/libxml/tree.h; then -+ if test -r $i/include/libxml2/libxml/tree.h; then - DOMXML_DIR=$i - AC_MSG_RESULT(found in $i) - fi ---- php-4.0.6/ext/domxml/Makefile.in~ Thu Nov 15 01:20:18 2001 -+++ php-4.0.6/ext/domxml/Makefile.in Thu Nov 15 01:20:18 2001 -@@ -5,4 +5,6 @@ - LTLIBRARY_SHARED_NAME = domxml.la - LTLIBRARY_SHARED_LIBADD = $(DOMXML_SHARED_LIBADD) - -+EXTRA_CFLAGS = `pkg-config libxml-2.0 --cflags` -+ - include $(top_srcdir)/build/dynlib.mk diff --git a/php-mailsecurity2.patch b/php-mailsecurity2.patch deleted file mode 100644 index 0e4e89d..0000000 --- a/php-mailsecurity2.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- php4/ext/standard/mail.c 2 Apr 2001 16:37:50 -0000 1.41 -+++ php4/ext/standard/mail.c 25 Sep 2001 22:48:43 -0000 1.44 -@@ -12,7 +12,7 @@ - +----------------------------------------------------------------------+ - */ - --/* $Id$ */ -+/* $Id$ */ - - #include - #include -@@ -54,8 +56,8 @@ - } - - convert_to_string_ex(pstr); -- if ((*pstr)->value.str.val) { -- str = (*pstr)->value.str.val; -+ if (Z_STRVAL_PP(pstr)) { -+ str = Z_STRVAL_PP(pstr); - } else { - php_error(E_WARNING, "Must give string parameter to ezmlm_hash()"); - RETURN_FALSE; -@@ -85,8 +88,8 @@ - } - /* To: */ - convert_to_string_ex(argv[0]); -- if ((*argv[0])->value.str.val) { -- to = (*argv[0])->value.str.val; -+ if (Z_STRVAL_PP(argv[0])) { -+ to = Z_STRVAL_PP(argv[0]); - } else { - php_error(E_WARNING, "No to field in mail command"); - RETURN_FALSE; -@@ -94,8 +97,8 @@ - - /* Subject: */ - convert_to_string_ex(argv[1]); -- if ((*argv[1])->value.str.val) { -+ if (Z_STRVAL_PP(argv[1])) { - subject = Z_STRVAL_PP(argv[1]); - } else { - php_error(E_WARNING, "No subject field in mail command"); - RETURN_FALSE; -@@ -103,8 +106,8 @@ - - /* message body */ - convert_to_string_ex(argv[2]); -- if ((*argv[2])->value.str.val) { -+ if (Z_STRVAL_PP(argv[2])) { - message = Z_STRVAL_PP(argv[2]); - } else { - /* this is not really an error, so it is allowed. */ - php_error(E_WARNING, "No message string in mail command"); diff --git a/php-oracle9.patch b/php-oracle9.patch deleted file mode 100644 index 8c115fc..0000000 --- a/php-oracle9.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -ur php-4.0.6/ext/oracle/config.m4 php-4.0.6.ora/ext/oracle/config.m4 ---- php-4.0.6/ext/oracle/config.m4 Sat May 12 11:29:07 2001 -+++ php-4.0.6.ora/ext/oracle/config.m4 Mon Sep 17 16:16:43 2001 -@@ -5,6 +5,8 @@ - if test -s "$ORACLE_DIR/orainst/unix.rgs"; then - ORACLE_VERSION=`grep '"ocommon"' $ORACLE_DIR/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4` - test -z "$ORACLE_VERSION" && ORACLE_VERSION=7.3 -+ elif test -f $ORACLE_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then -+ ORACLE_VERSION=9.0 - elif test -f $ORACLE_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then - ORACLE_VERSION=8.1 - elif test -f $ORACLE_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then -@@ -148,6 +150,10 @@ - ;; - - 8.1) -+ PHP_ADD_LIBRARY(clntsh, 1, ORACLE_SHARED_LIBADD) -+ PHP_ADD_LIBPATH($ORACLE_DIR/lib, ORACLE_SHARED_LIBADD) -+ ;; -+ 9.0) - PHP_ADD_LIBRARY(clntsh, 1, ORACLE_SHARED_LIBADD) - PHP_ADD_LIBPATH($ORACLE_DIR/lib, ORACLE_SHARED_LIBADD) - ;; diff --git a/php-pdflib4.0.2.patch b/php-pdflib4.0.2.patch deleted file mode 100644 index 5b20ca7..0000000 --- a/php-pdflib4.0.2.patch +++ /dev/null @@ -1,802 +0,0 @@ ---- php-4.1.2/ext/pdf/pdf.c.wiget Fri Oct 12 01:51:53 2001 -+++ php-4.1.2/ext/pdf/pdf.c Tue Jan 29 15:12:31 2002 -@@ -17,7 +17,18 @@ - +----------------------------------------------------------------------+ - */ - --/* $Id$ */ -+/* $Id$ */ -+/* derived from: -+ Id: pdf.c,v 1.105 2001/11/30 04:46:35 sniper Exp -+ -+ with some exeptions: -+ - pdf_get_major/minorversion not included, as pdf_get_value supports this -+ now without a PDF-object -+ - #if ZEND_MODULE_API_NO >= 20010901 for new ZEND_MODULE support, -+ so that it compiles with older PHP Versions too -+ - TSRMLS fixes included only with ZEND_MODULE_API_NO >= 20010901 -+ would break older builds otherwise -+ */ - - /* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE. - Copyright (C) 1997-1999 Thomas Merz. 2000-2001 PDFlib GmbH */ -@@ -236,7 +247,9 @@ - /* {{{ pdf_module_entry - */ - zend_module_entry pdf_module_entry = { -+#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -+#endif - "pdf", - pdf_functions, - PHP_MINIT(pdf), -@@ -244,7 +257,9 @@ - NULL, - NULL, - PHP_MINFO(pdf), -+#if ZEND_MODULE_API_NO >= 20010901 - NO_VERSION_YET, -+#endif - STANDARD_MODULE_PROPERTIES - }; - /* }}} */ -@@ -255,14 +270,10 @@ - - /* {{{ _free_pdf_doc - */ --static void _free_pdf_doc(zend_rsrc_list_entry *rsrc TSRMLS_DC) -+static void _free_pdf_doc(zend_rsrc_list_entry *rsrc) - { -- /* RJS: TODO: - PDF *pdf = (PDF *)rsrc->ptr; -- check whether pdf-Pointer is still valid, before pdf_delete() -- + remove php-resource */ -- /* PDF_delete(pdf); --*/ -+ PDF_delete(pdf); - } - /* }}} */ - -@@ -327,9 +338,14 @@ - */ - static size_t pdf_flushwrite(PDF *p, void *data, size_t size) - { -+#if ZEND_MODULE_API_NO >= 20010901 - TSRMLS_FETCH(); - - return(php_write(data, size TSRMLS_CC)); -+#else -+ return(php_write(data, size)); -+#endif -+ return 0; - } - /* }}} */ - -@@ -349,7 +365,7 @@ - #else - php_info_print_table_row(2, "PDFlib GmbH Version", tmp ); - #endif -- php_info_print_table_row(2, "Revision", "$Revision$" ); -+ php_info_print_table_row(2, "Revision", "$Revision$" ); - php_info_print_table_end(); - - } -@@ -402,7 +418,7 @@ - - /* {{{ proto bool pdf_set_info(int pdfdoc, string fieldname, string value) - Fills an info field of the document */ --PHP_FUNCTION(pdf_set_info) -+PHP_FUNCTION(pdf_set_info) - { - zval **arg1, **arg2, **arg3; - PDF *pdf; -@@ -447,7 +463,7 @@ - - /* {{{ proto bool pdf_set_info_author(int pdfdoc, string author) - Fills the author field of the document */ --PHP_FUNCTION(pdf_set_info_author) -+PHP_FUNCTION(pdf_set_info_author) - { - _php_pdf_set_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, "Author"); - } -@@ -463,7 +479,7 @@ - - /* {{{ proto int pdf_open([int filedesc]) - Opens a new pdf document. If filedesc is NULL, document is created in memory. This is the old interface, only for compatibility use pdf_new + pdf_open_file instead */ --PHP_FUNCTION(pdf_open) -+PHP_FUNCTION(pdf_open) - { - zval **file; - FILE *fp; -@@ -498,7 +514,7 @@ - - /* {{{ proto void pdf_close(int pdfdoc) - Closes the pdf document */ --PHP_FUNCTION(pdf_close) -+PHP_FUNCTION(pdf_close) - { - zval **arg1; - PDF *pdf; -@@ -516,9 +532,9 @@ - - /* }}} */ - --/* {{{ proto void pdf_begin_page(int pdfdoc, double width, double height) -+/* {{{ proto void pdf_begin_page(int pdfdoc, float width, float height) - Starts page */ --PHP_FUNCTION(pdf_begin_page) -+PHP_FUNCTION(pdf_begin_page) - { - zval **arg1, **arg2, **arg3; - PDF *pdf; -@@ -538,7 +554,7 @@ - - /* {{{ proto void pdf_end_page(int pdfdoc) - Ends page */ --PHP_FUNCTION(pdf_end_page) -+PHP_FUNCTION(pdf_end_page) - { - zval **arg1; - PDF *pdf; -@@ -556,7 +572,7 @@ - - /* {{{ proto void pdf_show(int pdfdoc, string text) - Output text at current position */ --PHP_FUNCTION(pdf_show) -+PHP_FUNCTION(pdf_show) - { - zval **arg1, **arg2; - PDF *pdf; -@@ -573,9 +589,9 @@ - } - /* }}} */ - --/* {{{ proto void pdf_show_xy(int pdfdoc, string text, double x-koor, double y-koor) -+/* {{{ proto void pdf_show_xy(int pdfdoc, string text, float x_koor, float y_koor) - Output text at position */ --PHP_FUNCTION(pdf_show_xy) -+PHP_FUNCTION(pdf_show_xy) - { - zval **arg1, **arg2, **arg3, **arg4; - PDF *pdf; -@@ -594,9 +610,9 @@ - } - /* }}} */ - --/* {{{ proto int pdf_show_boxed(int pdfdoc, string text, double x-koor, double y-koor, double width, double height, string mode [, string feature]) -+/* {{{ proto int pdf_show_boxed(int pdfdoc, string text, float x_koor, float y_koor, float width, float height, string mode [, string feature]) - Output text formated in a boxed */ --PHP_FUNCTION(pdf_show_boxed) -+PHP_FUNCTION(pdf_show_boxed) - { - zval **argv[8]; - int argc = ZEND_NUM_ARGS(); -@@ -636,9 +652,9 @@ - } - /* }}} */ - --/* {{{ proto void pdf_set_font(int pdfdoc, string font, double size, string encoding [, int embed]) -+/* {{{ proto void pdf_set_font(int pdfdoc, string font, float size, string encoding [, int embed]) - Select the current font face, size and encoding */ --PHP_FUNCTION(pdf_set_font) -+PHP_FUNCTION(pdf_set_font) - { - zval **arg1, **arg2, **arg3, **arg4, **arg5; - int font, embed; -@@ -699,7 +715,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_set_value(int pdfdoc, string key, double value) -+/* {{{ proto void pdf_set_value(int pdfdoc, string key, float value) - Sets arbitrary value */ - PHP_FUNCTION(pdf_set_value) - { -@@ -720,7 +736,7 @@ - } - /* }}} */ - --/* {{{ proto double pdf_get_value(int pdfdoc, string key, double modifier) -+/* {{{ proto float pdf_get_value(int pdfdoc, string key, float modifier) - Gets arbitrary value */ - PHP_FUNCTION(pdf_get_value) - { -@@ -751,6 +767,15 @@ - } else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "resy"))) { - if(argc < 3) WRONG_PARAM_COUNT; - value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_IMAGE_OFFSET); -+ } else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "capheight"))) { -+ if(argc < 3) WRONG_PARAM_COUNT; -+ value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_FONT_OFFSET); -+ } else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "ascender"))) { -+ if(argc < 3) WRONG_PARAM_COUNT; -+ value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_FONT_OFFSET); -+ } else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "descender"))) { -+ if(argc < 3) WRONG_PARAM_COUNT; -+ value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_FONT_OFFSET); - } else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "font"))) { - value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), 0.0)+PDFLIB_FONT_OFFSET; - } else { -@@ -803,7 +828,7 @@ - } - /* }}} */ - --/* {{{ proto double pdf_get_fontsize(int pdfdoc) -+/* {{{ proto float pdf_get_fontsize(int pdfdoc) - Gets the current font size */ - PHP_FUNCTION(pdf_get_fontsize) - { -@@ -822,7 +847,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_set_leading(int pdfdoc, double distance) -+/* {{{ proto void pdf_set_leading(int pdfdoc, float distance) - Sets distance between text lines */ - PHP_FUNCTION(pdf_set_leading) - { -@@ -838,7 +863,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_set_horiz_scaling(int pdfdoc, double scale) -+/* {{{ proto void pdf_set_horiz_scaling(int pdfdoc, float scale) - Sets horizontal scaling of text */ - PHP_FUNCTION(pdf_set_horiz_scaling) - { -@@ -846,7 +871,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_set_text_rise(int pdfdoc, double value) -+/* {{{ proto void pdf_set_text_rise(int pdfdoc, float value) - Sets the text rise */ - PHP_FUNCTION(pdf_set_text_rise) - { -@@ -854,7 +879,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_set_char_spacing(int pdfdoc, double space) -+/* {{{ proto void pdf_set_char_spacing(int pdfdoc, float space) - Sets character spacing */ - PHP_FUNCTION(pdf_set_char_spacing) - { -@@ -862,7 +887,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_set_word_spacing(int pdfdoc, double space) -+/* {{{ proto void pdf_set_word_spacing(int pdfdoc, float space) - Sets spacing between words */ - PHP_FUNCTION(pdf_set_word_spacing) - { -@@ -870,7 +895,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_set_text_pos(int pdfdoc, double x, double y) -+/* {{{ proto void pdf_set_text_pos(int pdfdoc, float x, float y) - Sets the position of text for the next pdf_show call */ - PHP_FUNCTION(pdf_set_text_pos) - { -@@ -909,7 +934,7 @@ - } - /* }}} */ - --/* {{{ proto double pdf_stringwidth(int pdfdoc, string text [, int font, double size]) -+/* {{{ proto float pdf_stringwidth(int pdfdoc, string text [, int font, float size]) - Returns width of text in current font */ - PHP_FUNCTION(pdf_stringwidth) - { -@@ -990,7 +1015,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_translate(int pdfdoc, double x, double y) -+/* {{{ proto void pdf_translate(int pdfdoc, float x, float y) - Sets origin of coordinate system */ - PHP_FUNCTION(pdf_translate) - { -@@ -1010,7 +1035,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_scale(int pdfdoc, double x-scale, double y-scale) -+/* {{{ proto void pdf_scale(int pdfdoc, float x_scale, float y_scale) - Sets scaling */ - PHP_FUNCTION(pdf_scale) - { -@@ -1030,7 +1055,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_rotate(int pdfdoc, double angle) -+/* {{{ proto void pdf_rotate(int pdfdoc, float angle) - Sets rotation */ - PHP_FUNCTION(pdf_rotate) - { -@@ -1049,7 +1074,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_skew(int pdfdoc, double xangle, double yangle) -+/* {{{ proto void pdf_skew(int pdfdoc, float xangle, float yangle) - Skew the coordinate system */ - PHP_FUNCTION(pdf_skew) - { -@@ -1069,7 +1094,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_setflat(int pdfdoc, double value) -+/* {{{ proto void pdf_setflat(int pdfdoc, float value) - Sets flatness */ - PHP_FUNCTION(pdf_setflat) - { -@@ -1147,7 +1172,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_setmiterlimit(int pdfdoc, double value) -+/* {{{ proto void pdf_setmiterlimit(int pdfdoc, float value) - Sets miter limit */ - PHP_FUNCTION(pdf_setmiterlimit) - { -@@ -1173,7 +1198,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_setlinewidth(int pdfdoc, double width) -+/* {{{ proto void pdf_setlinewidth(int pdfdoc, float width) - Sets line width */ - PHP_FUNCTION(pdf_setlinewidth) - { -@@ -1192,7 +1217,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_setdash(int pdfdoc, double black, double white) -+/* {{{ proto void pdf_setdash(int pdfdoc, float black, float white) - Sets dash pattern */ - PHP_FUNCTION(pdf_setdash) - { -@@ -1212,7 +1237,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_moveto(int pdfdoc, double x, double y) -+/* {{{ proto void pdf_moveto(int pdfdoc, float x, float y) - Sets current point */ - PHP_FUNCTION(pdf_moveto) - { -@@ -1232,7 +1257,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_curveto(int pdfdoc, double x1, double y1, double x2, double y2, double x3, double y3) -+/* {{{ proto void pdf_curveto(int pdfdoc, float x1, float y1, float x2, float y2, float x3, float y3) - Draws a curve */ - PHP_FUNCTION(pdf_curveto) - { -@@ -1263,7 +1288,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_lineto(int pdfdoc, double x, double y) -+/* {{{ proto void pdf_lineto(int pdfdoc, float x, float y) - Draws a line */ - PHP_FUNCTION(pdf_lineto) - { -@@ -1283,7 +1308,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_circle(int pdfdoc, double x, double y, double radius) -+/* {{{ proto void pdf_circle(int pdfdoc, float x, float y, float radius) - Draws a circle */ - PHP_FUNCTION(pdf_circle) - { -@@ -1304,7 +1329,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_arc(int pdfdoc, double x, double y, double radius, double start, double end) -+/* {{{ proto void pdf_arc(int pdfdoc, float x, float y, float radius, float start, float end) - Draws an arc */ - PHP_FUNCTION(pdf_arc) - { -@@ -1333,7 +1358,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_rect(int pdfdoc, double x, double y, double width, double height) -+/* {{{ proto void pdf_rect(int pdfdoc, float x, float y, float width, float height) - Draws a rectangle */ - PHP_FUNCTION(pdf_rect) - { -@@ -1552,7 +1577,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_setgray_fill(int pdfdoc, double value) -+/* {{{ proto void pdf_setgray_fill(int pdfdoc, float value) - Sets filling color to gray value */ - PHP_FUNCTION(pdf_setgray_fill) - { -@@ -1575,7 +1600,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_setgray_stroke(int pdfdoc, double value) -+/* {{{ proto void pdf_setgray_stroke(int pdfdoc, float value) - Sets drawing color to gray value */ - PHP_FUNCTION(pdf_setgray_stroke) - { -@@ -1598,7 +1623,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_setgray(int pdfdoc, double value) -+/* {{{ proto void pdf_setgray(int pdfdoc, float value) - Sets drawing and filling color to gray value */ - PHP_FUNCTION(pdf_setgray) - { -@@ -1621,7 +1646,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_setrgbcolor_fill(int pdfdoc, double red, double green, double blue) -+/* {{{ proto void pdf_setrgbcolor_fill(int pdfdoc, float red, float green, float blue) - Sets filling color to RGB color value */ - PHP_FUNCTION(pdf_setrgbcolor_fill) - { -@@ -1646,7 +1671,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_setrgbcolor_stroke(int pdfdoc, double red, double green, double blue) -+/* {{{ proto void pdf_setrgbcolor_stroke(int pdfdoc, float red, float green, float blue) - Sets drawing color to RGB color value */ - PHP_FUNCTION(pdf_setrgbcolor_stroke) - { -@@ -1671,7 +1696,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_setrgbcolor(int pdfdoc, double red, double green, double blue) -+/* {{{ proto void pdf_setrgbcolor(int pdfdoc, float red, float green, float blue) - Sets drawing and filling color to RGB color value */ - PHP_FUNCTION(pdf_setrgbcolor) - { -@@ -1798,7 +1823,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_set_duration(int pdfdoc, double duration) -+/* {{{ proto void pdf_set_duration(int pdfdoc, float duration) - Sets duration between pages */ - PHP_FUNCTION(pdf_set_duration) - { -@@ -1835,7 +1860,11 @@ - convert_to_string_ex(arg2); - - #ifdef VIRTUAL_DIR -+# if ZEND_MODULE_API_NO >= 20010901 - virtual_filepath(Z_STRVAL_PP(arg2), &image TSRMLS_CC); -+# else -+ virtual_filepath(Z_STRVAL_PP(arg2), &image); -+# endif - #else - image = Z_STRVAL_PP(arg2); - #endif -@@ -1908,7 +1937,11 @@ - convert_to_string_ex(arg3); - - #ifdef VIRTUAL_DIR -+# if ZEND_MODULE_API_NO >= 20010901 - virtual_filepath(Z_STRVAL_PP(arg3), &image TSRMLS_CC); -+# else -+ virtual_filepath(Z_STRVAL_PP(arg3), &image); -+# endif - #else - image = Z_STRVAL_PP(arg3); - #endif -@@ -2013,7 +2046,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_place_image(int pdf, int pdfimage, double x, double y, double scale) -+/* {{{ proto void pdf_place_image(int pdf, int pdfimage, float x, float y, float scale) - Places image in the PDF document */ - PHP_FUNCTION(pdf_place_image) - { -@@ -2076,7 +2109,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_add_weblink(int pdfdoc, double llx, double lly, double urx, double ury, string url) -+/* {{{ proto void pdf_add_weblink(int pdfdoc, float llx, float lly, float urx, float ury, string url) - Adds link to web resource */ - PHP_FUNCTION(pdf_add_weblink) - { -@@ -2103,7 +2136,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_add_pdflink(int pdfdoc, double llx, double lly, double urx, double ury, string filename, int page, string dest) -+/* {{{ proto void pdf_add_pdflink(int pdfdoc, float llx, float lly, float urx, float ury, string filename, int page, string dest) - Adds link to PDF document */ - PHP_FUNCTION(pdf_add_pdflink) - { -@@ -2135,7 +2168,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_set_border_style(int pdfdoc, string style, double width) -+/* {{{ proto void pdf_set_border_style(int pdfdoc, string style, float width) - Sets style of box surounding all kinds of annotations and link */ - PHP_FUNCTION(pdf_set_border_style) - { -@@ -2155,7 +2188,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_set_border_color(int pdfdoc, double red, double green, double blue) -+/* {{{ proto void pdf_set_border_color(int pdfdoc, float red, float green, float blue) - Sets color of box surounded all kinds of annotations and links */ - PHP_FUNCTION(pdf_set_border_color) - { -@@ -2176,7 +2209,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_set_border_dash(int pdfdoc, double black, double white) -+/* {{{ proto void pdf_set_border_dash(int pdfdoc, float black, float white) - Sets the border dash style of all kinds of annotations and links */ - PHP_FUNCTION(pdf_set_border_dash) - { -@@ -2196,7 +2229,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_add_annotation(int pdfdoc, double xll, double yll, double xur, double xur, string title, string text) -+/* {{{ proto void pdf_add_annotation(int pdfdoc, float xll, float yll, float xur, float xur, string title, string text) - Sets annotation (depreciated use pdf_add_note instead) */ - PHP_FUNCTION(pdf_add_annotation) - { -@@ -2247,7 +2280,7 @@ - - /* }}} */ - --/* {{{ proto void pdf_delete(int pdfdoc) -+/* {{{ proto bool pdf_delete(int pdfdoc) - Deletes the PDF object */ - PHP_FUNCTION(pdf_delete) - { -@@ -2260,8 +2293,11 @@ - - ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); - -- PDF_delete(pdf); -- zend_list_delete(Z_LVAL_PP(arg1)); -+#ifndef Z_RESVAL /* for php 4.0.3pl1 */ -+#define Z_RESVAL(zval) (zval).value.lval -+#define Z_RESVAL_PP(zval_pp) Z_RESVAL(**zval_pp) -+#endif -+ zend_list_delete(Z_RESVAL_PP(arg1)); - - RETURN_TRUE; - } -@@ -2406,7 +2442,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_setpolydash(int pdfdoc, double darray) -+/* {{{ proto void pdf_setpolydash(int pdfdoc, float darray) - Sets more complicated dash pattern */ - - PHP_FUNCTION(pdf_setpolydash) -@@ -2436,10 +2472,10 @@ - - zend_hash_get_current_data(array, (void **) &keydataptr); - keydata = *keydataptr; -- if (keydata->type == IS_DOUBLE) { -- darray[i] = (float) keydata->value.dval; -- } else if (keydata->type == IS_LONG) { -- darray[i] = (float) keydata->value.lval; -+ if (Z_TYPE_P(keydata) == IS_DOUBLE) { -+ darray[i] = (float) Z_DVAL_P(keydata); -+ } else if (Z_TYPE_P(keydata) == IS_LONG) { -+ darray[i] = (float) Z_LVAL_P(keydata); - } else { - php_error(E_WARNING,"PDFlib set_polydash: illegal darray value"); - } -@@ -2453,7 +2489,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_concat(int pdf, double a, double b, double c, double d, double e, double f) -+/* {{{ proto void pdf_concat(int pdf, float a, float b, float c, float d, float e, float f) - Concatenates a matrix to the current transformation matrix for text and graphics */ - PHP_FUNCTION(pdf_concat) - { -@@ -2502,7 +2538,11 @@ - - convert_to_string_ex(arg2); - #ifdef VIRTUAL_DIR -+# if ZEND_MODULE_API_NO >= 20010901 - virtual_filepath(Z_STRVAL_PP(arg2), &image TSRMLS_CC); -+# else -+ virtual_filepath(Z_STRVAL_PP(arg2), &image); -+# endif - #else - image = Z_STRVAL_PP(arg2); - #endif -@@ -2551,7 +2591,11 @@ - convert_to_string_ex(arg10); - - #ifdef VIRTUAL_DIR -+# if ZEND_MODULE_API_NO >= 20010901 - virtual_filepath(Z_STRVAL_PP(arg4), &image TSRMLS_CC); -+# else -+ virtual_filepath(Z_STRVAL_PP(arg4), &image); -+# endif - #else - image = Z_STRVAL_PP(arg4); - #endif -@@ -2571,7 +2615,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_attach_file(int pdf, double lly, double lly, double urx, double ury, string filename, string description, string author, string mimetype, string icon) -+/* {{{ proto void pdf_attach_file(int pdf, float lly, float lly, float urx, float ury, string filename, string description, string author, string mimetype, string icon) - Adds a file attachment annotation at the rectangle specified by his lower left and upper right corners */ - PHP_FUNCTION(pdf_attach_file) - { -@@ -2609,7 +2653,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_add_note(int pdfdoc, double llx, double lly, double urx, double ury, string contents, string title, string icon, int open) -+/* {{{ proto void pdf_add_note(int pdfdoc, float llx, float lly, float urx, float ury, string contents, string title, string icon, int open) - Sets annotation */ - PHP_FUNCTION(pdf_add_note) - { -@@ -2645,7 +2689,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_add_locallink(int pdfdoc, double llx, double lly, double urx, double ury, int page, string dest) -+/* {{{ proto void pdf_add_locallink(int pdfdoc, float llx, float lly, float urx, float ury, int page, string dest) - Adds link to web resource */ - PHP_FUNCTION(pdf_add_locallink) - { -@@ -2677,7 +2721,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_add_launchlink(int pdfdoc, double llx, double lly, double urx, double ury, string filename) -+/* {{{ proto void pdf_add_launchlink(int pdfdoc, float llx, float lly, float urx, float ury, string filename) - Adds link to web resource */ - PHP_FUNCTION(pdf_add_launchlink) - { -@@ -2729,7 +2773,11 @@ - convert_to_long_ex(arg4); - - #ifdef VIRTUAL_DIR -+# if ZEND_MODULE_API_NO >= 20010901 - virtual_filepath(Z_STRVAL_PP(arg2), &file TSRMLS_CC); -+# else -+ virtual_filepath(Z_STRVAL_PP(arg2), &file); -+# endif - #else - file = Z_STRVAL_PP(arg2); - #endif -@@ -2792,7 +2840,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_place_pdi_page(int pdf, int page, double x, double y, double sx, double sy) -+/* {{{ proto void pdf_place_pdi_page(int pdf, int page, float x, float y, float sx, float sy) - * Place a PDF page with the lower left corner at (x, y), and scale it. */ - PHP_FUNCTION(pdf_place_pdi_page) - { -@@ -2875,7 +2923,7 @@ - } - /* }}} */ - --/* {{{ proto double pdf_get_pdi_value(int pdf, string key, int doc, int page, int index); -+/* {{{ proto float pdf_get_pdi_value(int pdf, string key, int doc, int page, int index); - * Get the contents of some PDI document parameter with numerical type. */ - PHP_FUNCTION(pdf_get_pdi_value) - { -@@ -2904,7 +2952,7 @@ - } - /* }}} */ - --/* {{{ proto int pdf_begin_pattern(int pdf, double width, double height, double xstep, double ystep, int painttype); -+/* {{{ proto int pdf_begin_pattern(int pdf, float width, float height, float xstep, float ystep, int painttype); - * Start a new pattern definition. */ - PHP_FUNCTION(pdf_begin_pattern) - { -@@ -2954,7 +3002,7 @@ - } - /* }}} */ - --/* {{{ proto int pdf_begin_template(int pdf, double width, double height); -+/* {{{ proto int pdf_begin_template(int pdf, float width, float height); - * Start a new template definition. */ - PHP_FUNCTION(pdf_begin_template) - { -@@ -2999,7 +3047,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_setcolor(int pdf, string type, string colorspace, double c1 [, double c2 [, double c3 [, double c4]]]); -+/* {{{ proto void pdf_setcolor(int pdf, string type, string colorspace, float c1 [, float c2 [, float c3 [, float c4]]]); - * Set the current color space and color. */ - PHP_FUNCTION(pdf_setcolor) - { -@@ -3087,7 +3135,7 @@ - } - /* }}} */ - --/* {{{ proto void pdf_arcn(int pdf, double x, double y, double r, double alpha, double beta); -+/* {{{ proto void pdf_arcn(int pdf, float x, float y, float r, float alpha, float beta); - * Draw a clockwise circular arc from alpha to beta degrees. */ - PHP_FUNCTION(pdf_arcn) - { -@@ -3158,10 +3206,10 @@ - } - /* }}} */ - --/* {{{ proto void pdf_setmatrix(int pdf, double a, double b, double c, double d, double e, double f) -+/* {{{ proto void pdf_setmatrix(int pdf, float a, float b, float c, float d, float e, float f) - Explicitly set the current transformation matrix. */ - PHP_FUNCTION(pdf_setmatrix) --{ -+{ - zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7; - PDF *pdf; - -@@ -3189,6 +3237,7 @@ - RETURN_TRUE; - } - /* }}} */ -+ - #endif /* PDFlib >= V4 */ - - #endif -@@ -3198,6 +3247,6 @@ - * tab-width: 4 - * c-basic-offset: 4 - * End: -- * vim600: sw=4 ts=4 tw=78 fdm=marker -- * vim<600: sw=4 ts=4 tw=78 -+ * vim600: sw=4 ts=4 fdm=marker -+ * vim<600: sw=4 ts=4 - */ ---- php-4.1.2/ext/pdf/php_pdf.h.wiget Tue Aug 7 19:26:32 2001 -+++ php-4.1.2/ext/pdf/php_pdf.h Mon Dec 3 21:53:06 2001 -@@ -16,17 +16,15 @@ - +----------------------------------------------------------------------+ - */ - --/* $Id$ */ -+/* $Id$ */ -+/* Derived from: -+ Id: php_pdf.h,v 1.22 2001/11/30 04:46:35 sniper Exp */ - - #ifndef PHP_PDF_H - #define PHP_PDF_H - - #if HAVE_PDFLIB - --/* with version 2.20 of pdflib PDF_open_mem isn't available unless -- the following define isn't there. --*/ --#define PDF_OPEN_MEM_SUPPORTED - #include - - extern zend_module_entry pdf_module_entry; diff --git a/php-pearinstall.patch b/php-pearinstall.patch deleted file mode 100644 index 471bee9..0000000 --- a/php-pearinstall.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- php-4.0.6/configure.in.pear Mon Jul 9 12:11:47 2001 -+++ php-4.0.6/configure.in Mon Jul 9 12:19:09 2001 -@@ -501,13 +501,14 @@ - - if test "x$PHP_PEAR" != "xno"; then - PEAR_DIR=pear --fi -- --if test "x$PHP_PEAR" = "xDEFAULT"; then -- case $PHP_LAYOUT in -- GNU) PEAR_INSTALLDIR="$datadir/pear";; -- *) PEAR_INSTALLDIR="$libdir/php";; -- esac -+ if test "x$PHP_PEAR" = "xDEFAULT" -o "x$PHP_PEAR" = "xyes" ; then -+ case $PHP_LAYOUT in -+ GNU) PEAR_INSTALLDIR="$datadir/pear";; -+ *) PEAR_INSTALLDIR="$libdir/php";; -+ esac -+ else -+ PEAR_INSTALLDIR="$PHP_PEAR" -+ fi - fi - - test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS" diff --git a/php-register_shutdown_function.patch b/php-register_shutdown_function.patch deleted file mode 100644 index 8a7b3ee..0000000 --- a/php-register_shutdown_function.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- php-4.1.1/sapi/apache/sapi_apache.c Sat Aug 4 21:42:45 2001 -+++ ../php-4.1.1-changed/php-4.1.1/sapi/apache/sapi_apache.c Thu Jan 24 -12:08:40 2002 -@@ -89,13 +89,13 @@ - - (void) php_execute_script(&file_handle TSRMLS_CC); - } -- -+/* - AP(in_request) = 0; - - zend_try { - php_request_shutdown(NULL); - } zend_end_try(); -- -+*/ - return (OK); - } - /* }}} */ diff --git a/php-xml_fix b/php-xml_fix deleted file mode 100644 index 6396be1..0000000 --- a/php-xml_fix +++ /dev/null @@ -1,11 +0,0 @@ -include $(top_builddir)/config_vars.mk -LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo) $(LTLIBRARY_OBJECTS_X) -LTLIBRARY_SHARED_OBJECTS = $(LTLIBRARY_OBJECTS:.lo=.slo) -$(LTLIBRARY_NAME): $(LTLIBRARY_OBJECTS) $(LTLIBRARY_DEPENDENCIES) - $(LINK) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_LIBADD) -$(LTLIBRARY_SHARED_NAME): $(LTLIBRARY_SHARED_OBJECTS) $(LTLIBRARY_DEPENDENCIES) - $(SHARED_LIBTOOL) --mode=link $(COMPILE) $(LDFLAGS) -o $@ -avoid-version -module -rpath $(phplibdir) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_SHARED_LIBADD) - $(SHARED_LIBTOOL) --mode=install cp $@ $(phplibdir) - -targets = $(LTLIBRARY_NAME) $(LTLIBRARY_SHARED_NAME) - -- 2.44.0