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] lsmith
isnt this a duplicate of the already fixed: http://pear.php.net/bugs/bug.php?id=5669
 [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] lsmith
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.