File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ Yii Framework 2 redis extension Change Log
442.0.6 under development
55-----------------------
66
7+ - Bug #67 : Fixed regression from 2.0.5, reconnecting a closed connection fails (cebe)
78- Enh: Optimized find by PK for relational queries and IN condition (cebe, andruha)
89
910
Original file line number Diff line number Diff line change @@ -306,7 +306,7 @@ public function close()
306306 \Yii::trace ('Closing DB connection: ' . $ connection , __METHOD__ );
307307 $ this ->executeCommand ('QUIT ' );
308308 stream_socket_shutdown ($ this ->_socket , STREAM_SHUT_RDWR );
309- $ this ->_socket = null ;
309+ $ this ->_socket = false ;
310310 }
311311 }
312312
Original file line number Diff line number Diff line change @@ -32,6 +32,22 @@ public function testConnect()
3232 $ db ->close ();
3333 }
3434
35+ /**
36+ * tests whether close cleans up correctly so that a new connect works
37+ */
38+ public function testReConnect ()
39+ {
40+ $ db = $ this ->getConnection (false );
41+ $ db ->open ();
42+ $ this ->assertTrue ($ db ->ping ());
43+ $ db ->close ();
44+
45+ $ db ->open ();
46+ $ this ->assertTrue ($ db ->ping ());
47+ $ db ->close ();
48+ }
49+
50+
3551 public function keyValueData ()
3652 {
3753 return [
You can’t perform that action at this time.
0 commit comments