helly           Sat Oct  1 11:49:30 2005 EDT

  Modified files:              (Branch: PHP_5_0)
    /php-src/ext/spl    spl_sxe.c 
  Log:
  - MF5.1 SPL may extend SimpleXML (if present)
  
http://cvs.php.net/diff.php/php-src/ext/spl/spl_sxe.c?r1=1.7&r2=1.7.2.1&ty=u
Index: php-src/ext/spl/spl_sxe.c
diff -u php-src/ext/spl/spl_sxe.c:1.7 php-src/ext/spl/spl_sxe.c:1.7.2.1
--- php-src/ext/spl/spl_sxe.c:1.7       Mon Mar  8 12:33:29 2004
+++ php-src/ext/spl/spl_sxe.c   Sat Oct  1 11:49:29 2005
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | PHP Version 5                                                        |
    +----------------------------------------------------------------------+
-   | Copyright (c) 1997-2003 The PHP Group                                |
+   | Copyright (c) 1997-2005 The PHP Group                                |
    +----------------------------------------------------------------------+
    | This source file is subject to version 3.0 of the PHP license,       |
    | that is bundled with this package in the file LICENSE, and is        |
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_sxe.c,v 1.7 2004/03/08 17:33:29 helly Exp $ */
+/* $Id: spl_sxe.c,v 1.7.2.1 2005/10/01 15:49:29 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -146,13 +146,16 @@
 
 SPL_API PHP_MINIT_FUNCTION(spl_sxe) /* {{{ */
 {
-       zend_class_entry *spl_ce_SimpleXML_Element = 
sxe_get_element_class_entry();
-
-       if (!spl_ce_SimpleXML_Element) {
+       zend_class_entry **pce, *spl_ce_SimpleXMLElement;
+       
+       if (zend_hash_find(CG(class_table), "simplexmlelement", 
sizeof("SimpleXMLElement"), (void **) &pce) == FAILURE) {
+               spl_ce_SimpleXMLIterator = NULL;
                return SUCCESS; /* SimpleXML must be initialized before */
        }
+       
+       spl_ce_SimpleXMLElement = *pce;
 
-       REGISTER_SPL_SUB_CLASS_EX(SimpleXMLIterator, SimpleXML_Element, 
sxe_object_new, spl_funcs_SimpleXMLIterator);
+       REGISTER_SPL_SUB_CLASS_EX(SimpleXMLIterator, SimpleXMLElement, 
sxe_object_new, spl_funcs_SimpleXMLIterator);
        REGISTER_SPL_IMPLEMENTS(SimpleXMLIterator, RecursiveIterator);
 
        return SUCCESS;

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

Reply via email to