cvs: php-src /ext/simplexml simplexml.c

From: Date: Mon, 30 Aug 2004 17:29:23 +0000
Subject: cvs: php-src /ext/simplexml simplexml.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-28507@lists.php.net to get a copy of this message
rrichards Mon Aug 30 13:29:23 2004 EDT Modified files: /php-src/ext/simplexml simplexml.c Log: remove cloning under ze1_compatibility_mode - minor BC break but doesnt work right under compat mode anyways http://cvs.php.net/diff.php/php-src/ext/simplexml/simplexml.c?r1=1.145&r2=1.146&ty=u Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.145 php-src/ext/simplexml/simplexml.c:1.146 --- php-src/ext/simplexml/simplexml.c:1.145 Fri Aug 6 12:36:00 2004 +++ php-src/ext/simplexml/simplexml.c Mon Aug 30 13:29:22 2004 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: simplexml.c,v 1.145 2004/08/06 16:36:00 pollita Exp $ */ +/* $Id: simplexml.c,v 1.146 2004/08/30 17:29:22 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1102,6 +1102,37 @@ NULL }; +static zend_object_handlers sxe_ze1_object_handlers = { + ZEND_OBJECTS_STORE_HANDLERS, + sxe_property_read, + sxe_property_write, + sxe_dimension_read, + sxe_dimension_write, + NULL, + sxe_get_value, /* get */ + NULL, + sxe_property_exists, + sxe_property_delete, + sxe_dimension_exists, + sxe_dimension_delete, + sxe_properties_get, + NULL, /* zend_get_std_object_handlers()->get_method,*/ + NULL, /* zend_get_std_object_handlers()->call_method,*/ + NULL, /* zend_get_std_object_handlers()->get_constructor, */ + NULL, /* zend_get_std_object_handlers()->get_class_entry,*/ + NULL, /* zend_get_std_object_handlers()->get_class_name,*/ + sxe_objects_compare, + sxe_object_cast, + NULL +}; + +static zend_object_value sxe_object_ze1_clone(zval *zobject TSRMLS_DC) +{ + php_error(E_ERROR, "Cannot clone object of class %s due to 'zend.ze1_compatibility_mode'", Z_OBJCE_P(zobject)->name); + /* Return zobject->value.obj just to satisfy compiler */ + return zobject->value.obj; +} + /* {{{ sxe_object_clone() */ static void @@ -1207,7 +1238,11 @@ zend_object_value rv; rv.handle = zend_objects_store_put(intern, sxe_object_dtor, (zend_objects_free_object_storage_t)sxe_object_free_storage, sxe_object_clone TSRMLS_CC); - rv.handlers = (zend_object_handlers *) &sxe_object_handlers; + if (EG(ze1_compatibility_mode)) { + rv.handlers = (zend_object_handlers *) &sxe_ze1_object_handlers; + } else { + rv.handlers = (zend_object_handlers *) &sxe_object_handlers; + } return rv; } @@ -1652,6 +1687,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; + sxe_ze1_object_handlers.get_method = zend_get_std_object_handlers()->get_method; + sxe_ze1_object_handlers.get_constructor = zend_get_std_object_handlers()->get_constructor; + sxe_ze1_object_handlers.get_class_entry = zend_get_std_object_handlers()->get_class_entry; + sxe_ze1_object_handlers.get_class_name = zend_get_std_object_handlers()->get_class_name; + sxe_ze1_object_handlers.clone_obj = sxe_object_ze1_clone; + #if HAVE_SPL && !defined(COMPILE_DL_SPL) if (zend_get_module_started("spl") == SUCCESS) { PHP_MINIT(spl_sxe)(INIT_FUNC_ARGS_PASSTHRU); @@ -1678,7 +1719,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "Simplexml support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.145 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.146 $"); php_info_print_table_row(2, "Schema support", #ifdef LIBXML_SCHEMAS_ENABLED "enabled");

« previous php.cvs (#28507) next »