Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12375 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28285 invoked by uid 1010); 26 Aug 2004 20:50:32 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 7054 invoked from network); 26 Aug 2004 20:47:09 -0000 Received: from unknown (HELO ctindustries.net) (216.117.147.250) by pb1.pair.com with SMTP; 26 Aug 2004 20:47:09 -0000 Received: from ctdprimary (dsta-aa203.pivot.net [66.186.171.203]) (authenticated bits=0) by ctindustries.net (8.12.8/8.12.8) with ESMTP id i7QJjMbx005358 for ; Thu, 26 Aug 2004 15:45:24 -0400 Message-ID: <074001c48bae$4ddd84f0$f7dea8c0@cyberware.local> To: Date: Thu, 26 Aug 2004 16:50:21 -0400 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_073D_01C48B8C.C6380960" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Subject: ze1_compatibility_mode and cloning From: rrichards@ctindustries.net ("Rob Richards") ------=_NextPart_000_073D_01C48B8C.C6380960 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit ze1_compatibility_mode when set on calls clone on objects implicitly and is causing some issues with extensions such as dom and xsl to name a few. Is it possible to add something like the contained patch, which would allow an object to implement an additional clone handler used only when the clone call is from the engine's ze1_compatibility_mode calls? i.e. the objects ze1 clone handler would be something like: zend_object_value dom_objects_ze1_clone_obj(zval *zobject TSRMLS_DC) { zend_objects_store_add_ref(zobject TSRMLS_CC); return zobject->value.obj; } so that a reference is returned rather than really cloning the internal object as a real clone is not desireable here unless the developer explicitly calls clone $obj. Rob ------=_NextPart_000_073D_01C48B8C.C6380960 Content-Type: text/plain; name="ze1clone.diff.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ze1clone.diff.txt" Index: zend_execute.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /repository/ZendEngine2/zend_execute.c,v retrieving revision 1.669 diff -r1.669 zend_execute.c 433c433 < if (Z_OBJ_HANDLER_P(value, clone_obj) =3D=3D NULL) { --- > if (Z_OBJ_HANDLER_P(value, clone_obj) =3D=3D NULL && = Z_OBJ_HANDLER_P(value, ze1_clone_obj) =3D=3D NULL) { 436,437c436,441 < zend_error(E_STRICT, "Implicit cloning object of class '%s' because = of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(orig_value)->name); =09 < value->value.obj =3D Z_OBJ_HANDLER_P(orig_value, = clone_obj)(orig_value TSRMLS_CC); --- > zend_error(E_STRICT, "Implicit cloning object of class '%s' because = of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(orig_value)->name); > if (Z_OBJ_HANDLER_P(value, ze1_clone_obj) !=3D NULL) { > value->value.obj =3D Z_OBJ_HANDLER_P(orig_value, = ze1_clone_obj)(orig_value TSRMLS_CC); > } else { > value->value.obj =3D Z_OBJ_HANDLER_P(orig_value, = clone_obj)(orig_value TSRMLS_CC); > } 607c611 < if (Z_OBJ_HANDLER_P(value, clone_obj) =3D=3D NULL) { --- > if (Z_OBJ_HANDLER_P(value, clone_obj) =3D=3D NULL && = Z_OBJ_HANDLER_P(value, ze1_clone_obj) =3D=3D NULL) { 622c626,630 < variable_ptr->value.obj =3D Z_OBJ_HANDLER_P(value, = clone_obj)(value TSRMLS_CC); --- > if (Z_OBJ_HANDLER_P(value, ze1_clone_obj) !=3D NULL) { > variable_ptr->value.obj =3D Z_OBJ_HANDLER_P(value, = ze1_clone_obj)(value TSRMLS_CC); > } else { > variable_ptr->value.obj =3D Z_OBJ_HANDLER_P(value, = clone_obj)(value TSRMLS_CC); > } 639c647,651 < variable_ptr->value.obj =3D Z_OBJ_HANDLER_P(value, clone_obj)(value = TSRMLS_CC); --- > if (Z_OBJ_HANDLER_P(value, ze1_clone_obj) !=3D NULL) { > variable_ptr->value.obj =3D Z_OBJ_HANDLER_P(value, = ze1_clone_obj)(value TSRMLS_CC); > } else { > variable_ptr->value.obj =3D Z_OBJ_HANDLER_P(value, = clone_obj)(value TSRMLS_CC); > } 3162c3174 < if (Z_OBJ_HT_P(retval_ptr)->clone_obj =3D=3D NULL) { --- > if (Z_OBJ_HT_P(retval_ptr)->clone_obj =3D=3D NULL && = Z_OBJ_HT_P(retval_ptr)->ze1_clone_obj =3D=3D NULL) { 3166c3178,3182 < (*EG(return_value_ptr_ptr))->value.obj =3D = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); --- > if (Z_OBJ_HT_P(retval_ptr)->ze1_clone_obj !=3D NULL) { > (*EG(return_value_ptr_ptr))->value.obj =3D = Z_OBJ_HT_P(retval_ptr)->ze1_clone_obj(retval_ptr TSRMLS_CC); > } else { > (*EG(return_value_ptr_ptr))->value.obj =3D = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); > } Index: zend_object_handlers.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /repository/ZendEngine2/zend_object_handlers.c,v retrieving revision 1.104 diff -r1.104 zend_object_handlers.c 981a982 > NULL, /* ze1_clone_obj */ Index: zend_object_handlers.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /repository/ZendEngine2/zend_object_handlers.h,v retrieving revision 1.41 diff -r1.41 zend_object_handlers.h 89a90 > typedef zend_object_value (*zend_object_ze1_clone_obj_t)(zval *object = TSRMLS_DC); 125a127 > zend_object_ze1_clone_obj_t ze1_clone_obj; ------=_NextPart_000_073D_01C48B8C.C6380960--