connect_error) { if (defined('headless')) { header("HTTP/1.1 503 Service Unavailable"); exit; } die("Database connection error (" . $this->connect_errno . ")"); } $this->set_charset('utf8'); } // returns singleton instance public static function getInstance() { if (!self::$instance) { $config = new uConfig(); self::$instance = new self($config::$dbhost, $config::$dbuser, $config::$dbpass, $config::$dbname); } return self::$instance; } } ?>