Re: [PHP] is there a static constructor?

2011-03-31 Thread Darren Karstens
class Daz_Config { private static $instance; private function __construct(){ $this-load(); } private function load() { ... } public function get($key) { ... } public static getInstance(){ if (!self::$instance) self::$instance = new Daz_Config();

Re: [PHP] is there a static constructor?

2011-03-31 Thread Admin
Why not just create a no named function in the top of the class. This this way it loads on include. Richard Buskirk Sent from my iPhone On Mar 31, 2011, at 12:56 AM, D. Dante Lorenso da...@lorenso.com wrote: All, I want to build a config file class that gets called statically. Is there

Re: [PHP] is there a static constructor?

2011-03-30 Thread Ryan
There is such thing, but its not called static constructor, its called singleton pattern class SingletonA { public static instance; public SingletonA(){} public static function getInstancce() { if(self::instance != null) { return self::instanc; } return new

Re: [PHP] is there a static constructor?

2011-03-30 Thread Peter Lind
On 31 March 2011 06:56, D. Dante Lorenso da...@lorenso.com wrote: All, I want to build a config file class that gets called statically.  Is there such a thing as a static constructor?  Example: class Daz_Config {  public static function load() {    ...  }  public static function