File tree 1 file changed +13
-3
lines changed
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 31
31
*/
32
32
class MysqliDriver extends DriverAbstract
33
33
{
34
+ private $ connected = false ;
35
+
34
36
/** @var mysqli */
35
37
private $ linkDB ; //DB-Link
36
38
@@ -51,6 +53,10 @@ class MysqliDriver extends DriverAbstract
51
53
*/
52
54
public function dbconnect (ConnectionParameters $ objParams )
53
55
{
56
+ if ($ this ->connected ) {
57
+ return true ;
58
+ }
59
+
54
60
$ port = $ objParams ->getPort ();
55
61
if (empty ($ port )) {
56
62
$ port = 3306 ;
@@ -79,6 +85,7 @@ public function dbconnect(ConnectionParameters $objParams)
79
85
$ this ->_pQuery ("SET character_set_database ='utf8' " , array ());
80
86
$ this ->_pQuery ("SET character_set_server ='utf8' " , array ());
81
87
88
+ $ this ->connected = true ;
82
89
return true ;
83
90
}
84
91
@@ -87,10 +94,13 @@ public function dbconnect(ConnectionParameters $objParams)
87
94
*/
88
95
public function dbclose ()
89
96
{
90
- if ($ this ->linkDB !== null ) {
91
- $ this ->linkDB ->close ();
92
- $ this ->linkDB = null ;
97
+ if (!$ this ->connected ) {
98
+ return ;
93
99
}
100
+
101
+ $ this ->linkDB ->close ();
102
+ $ this ->linkDB = null ;
103
+ $ this ->connected = false ;
94
104
}
95
105
96
106
/**
You can’t perform that action at this time.
0 commit comments