public static function getInstance() { if (is_null(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; }
private function __construct() { $this->messages = new CMsgGroup(); $this->db = CChatDB::getInstance(); if ($this->db->connect_error) { die('Connect error (' . $this->db->connect_errno . ') ' . $this->db->connect_error); } }