class Database { private static $instance = NULL; private function __construct() {} private function __clone() {} public static function getInstance() { if(!self::$instance) { self::$instance = new mysqli('localhost','username','password','database_name'); } return self::$instance; } } // Usage example $db = Database::getInstance();In the example above, the getInstance() method is called to get the database connection. If an instance of the connection does not already exist, it creates a new instance using the mysqli() constructor, otherwise it returns the existing connection. The package library for this example would be the PHP MySQLi extension, which is a built-in extension that provides a lightweight and high-performance interface to the MySQL database.