summaryrefslogtreecommitdiff
path: root/ext/dom/php_dom.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2006-06-05 16:53:21 +0000
committerZeev Suraski <zeev@php.net>2006-06-05 16:53:21 +0000
commit66b90c7052f43066abea88cfba25ea0c18acd961 (patch)
tree7a7f0b2ad144b77f882330353191fbe4ce664a8b /ext/dom/php_dom.c
parentb1683ea891459b102188ce5216f4718800834e2e (diff)
downloadphp-git-66b90c7052f43066abea88cfba25ea0c18acd961.tar.gz
Final ze1_compat restoration - it was mostly done by hand, so if anybody
spots any (new) problems, let me know. Test wise, the same tests that failed before are failing now.
Diffstat (limited to 'ext/dom/php_dom.c')
-rw-r--r--ext/dom/php_dom.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index 80437a13e3..038529e0d4 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -69,6 +69,7 @@ zend_class_entry *dom_xpath_class_entry;
zend_class_entry *dom_namespace_node_class_entry;
zend_object_handlers dom_object_handlers;
+zend_object_handlers dom_ze1_object_handlers;
static HashTable classes;
@@ -490,12 +491,25 @@ zend_object_value dom_objects_store_clone_obj(zval *zobject TSRMLS_DC)
return retval;
}
+
+zend_object_value dom_objects_ze1_clone_obj(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;
+}
+
static zend_function_entry dom_functions[] = {
PHP_FE(dom_import_simplexml, NULL)
{NULL, NULL, NULL}
};
static zend_object_handlers* dom_get_obj_handlers(TSRMLS_D) {
+ if (EG(ze1_compatibility_mode)) {
+ return &dom_ze1_object_handlers;
+ } else {
+ return &dom_object_handlers;
+ }
return &dom_object_handlers;
}
@@ -535,6 +549,13 @@ PHP_MINIT_FUNCTION(dom)
dom_object_handlers.clone_obj = dom_objects_store_clone_obj;
dom_object_handlers.has_property = dom_property_exists;
+ memcpy(&dom_ze1_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ dom_ze1_object_handlers.read_property = dom_read_property;
+ dom_ze1_object_handlers.write_property = dom_write_property;
+ dom_object_handlers.get_property_ptr_ptr = dom_get_property_ptr_ptr;
+ dom_ze1_object_handlers.clone_obj = dom_objects_ze1_clone_obj;
+ dom_ze1_object_handlers.has_property = dom_property_exists;
+
zend_hash_init(&classes, 0, NULL, NULL, 1);
INIT_CLASS_ENTRY(ce, "DOMException", php_dom_domexception_class_functions);