Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.0.4

Bug #3641 Translation2 is not cloneable
Submitted: 2005-02-28 18:36 UTC
From: ojai at nerim dot net Assigned: quipo
Status: Closed Package: Translation2
PHP Version: 5.0.2 OS: Linux Debian
Roadmaps: (Not assigned)    
Subscription  


 [2005-02-28 18:36 UTC] ojai at nerim dot net
Description: ------------ Translation2 version : current CVS Translation2 doesn't make use of a __clone() method to clone its internal object references. Here's a patch that corrects this issue : http://samalyse.com/ln/t2-clone.diff I think you should add a __clone() method to the Decorator as well. Reproduce code: --------------- require_once 'PEAR.php'; require_once 'Translation2.php'; $t2 =& Translation2::factory ('XML', array('filename' => 'i18n.xml')); $t2->setLang ('en'); $t2_clone = clone ($t2); $t2_clone->setLang('fr'); // This shouldn't change $t2 echo $t2->get('invoice','documents'); // But it does... Expected result: ---------------- Invoice Actual result: -------------- Facture

Comments

 [2005-03-03 16:37 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!