/** Use instead of constructor to get instance of class. * * @param array $conf Connection information. * @return object Instance of db_handling. */ public static function get_instance($db_host = null, $db_user = null, $db_pass = null, $db = null) { if (self::$instance === null) { self::$instance = new db_handling($db_host, $db_user, $db_pass, $db); } return self::$instance; }
public function __construct() { $this->db_handling = db_handling::get_instance(DB_HOST, DB_USER, DB_PASS, DB); }