Re: [LiveUser] How to get an existing LiveUser instance ?
| From: | Stephane GULLY | Date: | Tue, 16 Mar 2004 14:05:35 +0000 |
| Subject: | Re: [LiveUser] How to get an existing LiveUser instance ? | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11322@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
Kerphi wrote:Thank you, It works like a charm :o)Hi, I tried to use LiveUser package in my application. I've a problem because I call LiveUser::factory() twice and the second call generates an error. What I whould like to do is to automaticaly get an existing instance of LiveUser or create it if it doesn't exist. Is it possible in LiveUser package or should I create my own singleton to be sure that only one instance of LiveUser exists ?YOu should use the singleton() method instead. It will ensure that only a single instance of liveuser is created.