@@ -116,6 +116,16 @@ public function getParams()
116116 return $ this ->connection_params ;
117117 }
118118
119+ /**
120+ * Returns the internal encoding.
121+ *
122+ * @return string current multibyte internal encoding
123+ */
124+ public function getInternalEncoding ()
125+ {
126+ return $ this ->internal_encoding ;
127+ }
128+
119129 /**
120130 * Returns the connection parameters (host, port) for the current instance.
121131 *
@@ -156,13 +166,13 @@ public function connect($suppress_error = false)
156166 $ data = $ this ->getParams ();
157167 $ conn = mysqli_init ();
158168
159- if ( ! empty ($ data ['options ' ])) {
169+ if (! empty ($ data ['options ' ])) {
160170 foreach ($ data ['options ' ] as $ option => $ value ) {
161171 $ conn ->options ($ option , $ value );
162172 }
163173 }
164174
165- if ( ! $ suppress_error && ! $ this ->silence_connection_warning ) {
175+ if (! $ suppress_error && ! $ this ->silence_connection_warning ) {
166176 $ conn ->real_connect ($ data ['host ' ], null , null , null , (int ) $ data ['port ' ], $ data ['socket ' ]);
167177 } else {
168178 @ $ conn ->real_connect ($ data ['host ' ], null , null , null , (int ) $ data ['port ' ], $ data ['socket ' ]);
@@ -174,7 +184,6 @@ public function connect($suppress_error = false)
174184 }
175185
176186 $ conn ->set_charset ('utf8 ' );
177-
178187 $ this ->connection = $ conn ;
179188 $ this ->mbPush ();
180189
@@ -413,6 +422,8 @@ public function mbPush()
413422 {
414423 $ this ->internal_encoding = mb_internal_encoding ();
415424 mb_internal_encoding ('UTF-8 ' );
425+
426+ return $ this ;
416427 }
417428
418429 /**
@@ -422,5 +433,7 @@ public function mbPop()
422433 {
423434 mb_internal_encoding ($ this ->internal_encoding );
424435 $ this ->internal_encoding = null ;
436+
437+ return $ this ;
425438 }
426439}
0 commit comments