/** * Creates a Database object. Public access to singleton. * * @param string $db_cnf Which DB configuration to use * @return object The Database class instance */ public static function get_db($db_cnf = 'default') { if (NULL === self::$_inst) { self::$_inst = new Database($db_cnf); } return self::$_inst; }
private function __construct() { try { self::$_inst = new PDO(self::$dsn, self::$user, self::$pass); } catch (PDOException $e) { throw $e; } }