helly           Sun Jan 18 10:15:56 2004 EDT

  Modified files:              
    /php-src/ext/simplexml      php_simplexml.h simplexml.c 
  Log:
  Enable inherited classes inside SPL and respect order of module init.
  
  
Index: php-src/ext/simplexml/php_simplexml.h
diff -u php-src/ext/simplexml/php_simplexml.h:1.15 
php-src/ext/simplexml/php_simplexml.h:1.16
--- php-src/ext/simplexml/php_simplexml.h:1.15  Sun Jan 18 08:19:41 2004
+++ php-src/ext/simplexml/php_simplexml.h       Sun Jan 18 10:15:55 2004
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_simplexml.h,v 1.15 2004/01/18 13:19:41 helly Exp $ */
+/* $Id: php_simplexml.h,v 1.16 2004/01/18 15:15:55 helly Exp $ */
 
 #ifndef PHP_SIMPLEXML_H
 #define PHP_SIMPLEXML_H
@@ -80,7 +80,7 @@
 #define SIMPLEXML_G(v) (simplexml_globals.v)
 #endif
 
-PHP_API zend_class_entry *sxe_get_element_class_entry();
+ZEND_API zend_class_entry *sxe_get_element_class_entry();
 
 #endif
 
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.112 php-src/ext/simplexml/simplexml.c:1.113
--- php-src/ext/simplexml/simplexml.c:1.112     Sun Jan 18 08:19:41 2004
+++ php-src/ext/simplexml/simplexml.c   Sun Jan 18 10:15:56 2004
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: simplexml.c,v 1.112 2004/01/18 13:19:41 helly Exp $ */
+/* $Id: simplexml.c,v 1.113 2004/01/18 15:15:56 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -31,12 +31,16 @@
 #include "ext/standard/info.h"
 #include "ext/standard/php_string.h"
 #include "php_simplexml.h"
+#include "simplexml.h"
 #include "zend_default_classes.h"
 #include "zend_interfaces.h"
+#if HAVE_SPL
+#include "ext/spl/spl_sxe.h"
+#endif
 
 zend_class_entry *sxe_class_entry = NULL;
 
-PHP_API zend_class_entry *sxe_get_element_class_entry()
+ZEND_API zend_class_entry *sxe_get_element_class_entry()
 {
        return sxe_class_entry;
 }
@@ -45,23 +49,8 @@
 
 #define SXE_METHOD(func) PHP_METHOD(simplexml_element, func)
 
-#define SKIP_TEXT(__p) \
-       if ((__p)->type == XML_TEXT_NODE) { \
-               goto next_iter; \
-       }
-
-static php_sxe_object *php_sxe_object_new(zend_class_entry *ce TSRMLS_DC);
 static zend_object_value php_sxe_register_object(php_sxe_object * TSRMLS_DC);
 
-/* {{{ php_sxe_fetch_object()
- */
-static inline php_sxe_object *
-php_sxe_fetch_object(zval *object TSRMLS_DC)
-{
-       return (php_sxe_object *) zend_object_store_get_object(object TSRMLS_CC);
-}
-/* }}} */
-
 /* {{{ _node_as_zval()
  */
 static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, int 
itertype, char *name, char *prefix TSRMLS_DC)
@@ -106,8 +95,6 @@
        } \
 }
 
-static void php_sxe_reset_iterator(php_sxe_object *sxe TSRMLS_DC);
-
 static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node 
TSRMLS_DC) {
        php_sxe_object *intern;
        xmlNodePtr retnode = NULL;
@@ -1053,7 +1040,7 @@
 
 /* {{{ sxe_object_new()
  */
-static zend_object_value
+ZEND_API zend_object_value
 sxe_object_new(zend_class_entry *ce TSRMLS_DC)
 {
        php_sxe_object    *intern;
@@ -1186,7 +1173,7 @@
        php_sxe_iterator_rewind,
 };
 
-static void php_sxe_reset_iterator(php_sxe_object *sxe TSRMLS_DC)
+ZEND_API void php_sxe_reset_iterator(php_sxe_object *sxe TSRMLS_DC)
 {
        xmlNodePtr node;
        char *prefix;
@@ -1305,16 +1292,12 @@
 
 }
 
-static void php_sxe_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
+ZEND_API void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC)
 {
        xmlNodePtr      node;
        php_sxe_object  *intern;
-       php_sxe_object  *sxe;
        char *prefix;
 
-       php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
-       sxe = iterator->sxe;
-
        if (sxe->iter.data) {
                intern = (php_sxe_object *)zend_object_store_get_object(sxe->iter.data 
TSRMLS_CC);
                GET_NODE(intern, node)
@@ -1366,6 +1349,12 @@
        }
 }
 
+static void php_sxe_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
+{
+       php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
+       php_sxe_move_forward_iterator(iterator->sxe TSRMLS_CC);
+}
+
 static void php_sxe_iterator_rewind(zend_object_iterator *iter TSRMLS_DC)
 {
        php_sxe_object  *sxe;
@@ -1485,6 +1474,12 @@
        sxe_object_handlers.get_class_entry = 
zend_get_std_object_handlers()->get_class_entry;
        sxe_object_handlers.get_class_name = 
zend_get_std_object_handlers()->get_class_name;
 
+#if HAVE_SPL
+       if (zend_get_module_started("spl") == SUCCESS) {
+               PHP_MINIT(spl_sxe)(INIT_FUNC_ARGS_PASSTHRU);
+       }
+#endif /* HAVE_SPL */
+
        return SUCCESS;
 }
 /* }}} */
@@ -1495,7 +1490,7 @@
 {
        php_info_print_table_start();
        php_info_print_table_header(2, "Simplexml support", "enabled");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.112 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.113 $");
        php_info_print_table_row(2, "Schema support", 
 #ifdef LIBXML_SCHEMAS_ENABLED
                "enabled");

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to