/** * This implements the 'singleton' design pattern * * @param string Environment name to run (e.g. live, dev, test) * * @return rcmail The one and only instance */ static function get_instance($env = '') { if (!self::$instance || !is_a(self::$instance, 'rcmail')) { self::$instance = new rcmail($env); // init AFTER object was linked with self::$instance self::$instance->startup(); } return self::$instance; }
/** * This implements the 'singleton' design pattern * * @return object rcmail The one and only instance */ static function get_instance() { if (!self::$instance) { self::$instance = new rcmail(); self::$instance->startup(); // init AFTER object was linked with self::$instance } return self::$instance; }