cvs: php-src(PHP_5_0) /ext/simplexml simplexml.c
| From: | Rob Richards | Date: | Mon, 30 Aug 2004 17:29:59 +0000 |
| Subject: | cvs: php-src(PHP_5_0) /ext/simplexml simplexml.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-28508@lists.php.net to get a copy of this message | ||
rrichards Mon Aug 30 13:29:59 2004 EDT
Modified files: (Branch: PHP_5_0)
/php-src/ext/simplexml simplexml.c
Log:
MFH: 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.139.2.3&r2=1.139.2.4&ty=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.139.2.3 php-src/ext/simplexml/simplexml.c:1.139.2.4
--- php-src/ext/simplexml/simplexml.c:1.139.2.3 Fri Aug 6 13:35:59 2004
+++ php-src/ext/simplexml/simplexml.c Mon Aug 30 13:29:58 2004
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: simplexml.c,v 1.139.2.3 2004/08/06 17:35:59 pollita Exp $ */
+/* $Id: simplexml.c,v 1.139.2.4 2004/08/30 17:29:58 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1081,6 +1081,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
@@ -1186,7 +1217,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);
+ 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;
}
@@ -1630,6 +1665,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);
@@ -1656,7 +1697,7 @@
{
php_info_print_table_start();
php_info_print_table_header(2, "Simplexml support", "enabled");
- php_info_print_table_row(2, "Revision", "$Revision: 1.139.2.3 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.139.2.4 $");
php_info_print_table_row(2, "Schema support",
#ifdef LIBXML_SCHEMAS_ENABLED
"enabled");