Re: getting name of class from a parent
| From: | Richard Lynch | Date: | Wed, 15 Dec 2004 17:51:21 +0000 |
| Subject: | Re: getting name of class from a parent | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-204422@lists.php.net to get a copy of this message | ||
Rory Browne wrote:
> You may be wondering why I don't just " $instance = new utility_class
> " - the reason is that I want to only create one of these instances. I
> don't want any more than one instance of utility_class at any one
> time.
>
> I can't use get_class($this) either, because, there is no $this when
> I'm accessing the method staticly.
Google for "PHP class singleton"
You will find several solutions.
--
Like Music?
http://l-i-e.com/artists.htm