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

Bug #5905 LiveUser::singleton() doesn't return object
Submitted: 2005-11-09 16:06 UTC
From: c dot weyland at gmx dot de Assigned: lsmith
Status: Closed Package: LiveUser
PHP Version: 4.3.10 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2005-11-09 16:06 UTC] c dot weyland at gmx dot de
Description: ------------ example5 even doesn't work with the latest CVS Version (LiveUser.php,v 1.120 2005/11/08) because - uniqid is called without mandatory parameter - no instance is returned at all changing the code to the folliwing worked for me (not intensively tested!): function &singleton(&$conf, $signature = null) { static $instances; if (!isset($instances)) { $instances = array(); } if (is_null($signature)) { if (empty($instances)) { $signature = uniqid(rand()); } else { $signature = key($instances); } } if (!array_key_exists($signature, $instances)) { $instances[$signature] =& LiveUser::factory($conf); } return $instances[$signature]; }

Comments

 [2005-11-09 16:41 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!
 [2005-11-09 17:37 UTC] c dot weyland at gmx dot de
no, it is not a dupe because i am using the latest cvs version of LiveUser.php and thus using the code that was meant to fix the original bug. As you can see at [1] uniqid() is being called without any argument. [1] http://cvs.php.net/co.php/pear/LiveUser/LiveUser.php
 [2005-11-10 17:53 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!