diff options
author | Rob Richards <rrichards@php.net> | 2004-08-30 17:29:22 +0000 |
---|---|---|
committer | Rob Richards <rrichards@php.net> | 2004-08-30 17:29:22 +0000 |
commit | a50166004d8eb8a196c9397b4c5458114eed83e2 (patch) | |
tree | cc8b18041ad14e610891cc3f2566f002a10537b6 /ext/simplexml | |
parent | 02fa5aa0dc80076cefc35e598b544990dce9f236 (diff) | |
download | php-git-a50166004d8eb8a196c9397b4c5458114eed83e2.tar.gz |
remove cloning under ze1_compatibility_mode
- minor BC break but doesnt work right under compat mode anyways
Diffstat (limited to 'ext/simplexml')
-rw-r--r-- | ext/simplexml/simplexml.c | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 5519353027..3464c1b3a9 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1102,6 +1102,37 @@ static zend_object_handlers sxe_object_handlers = { 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 @@ php_sxe_register_object(php_sxe_object *intern TSRMLS_DC) 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 @@ PHP_MINIT_FUNCTION(simplexml) 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); |