From 43459aeaee2b98ef651da78f8a03ce22c23ebbeb Mon Sep 17 00:00:00 2001 From: Ravi Patel Date: Thu, 11 Oct 2018 16:00:56 +0530 Subject: [PATCH] Now getInstance function will create new MysqliDb object if one is not present. (#794) --- MysqliDb.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MysqliDb.php b/MysqliDb.php index 75d981f6..6a119b6b 100644 --- a/MysqliDb.php +++ b/MysqliDb.php @@ -428,7 +428,11 @@ public function mysqli() */ public static function getInstance() { - return self::$_instance; + if(isset(self::$_instance)) { + return self::$_instance; + } else { + return new MysqliDb(); + } } /**