Skip to content

Commit 43459ae

Browse files
ravibpatelavbdr
authored andcommitted
Now getInstance function will create new MysqliDb object if one is not present. (ThingEngineer#794)
1 parent 3a2ca85 commit 43459ae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

MysqliDb.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,11 @@ public function mysqli()
428428
*/
429429
public static function getInstance()
430430
{
431-
return self::$_instance;
431+
if(isset(self::$_instance)) {
432+
return self::$_instance;
433+
} else {
434+
return new MysqliDb();
435+
}
432436
}
433437

434438
/**

0 commit comments

Comments
 (0)