File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 13
13
"php" : " ^8.1" ,
14
14
"react/async" : " ^4 || ^3 || ^2" ,
15
15
"illuminate/database" : " ^11.19" ,
16
- "reactphp-x/mysql-pool" : " ^2.0@dev "
16
+ "reactphp-x/mysql-pool" : " ^2.0"
17
17
},
18
18
"autoload" : {
19
19
"psr-4" : {
Original file line number Diff line number Diff line change 8
8
class AsyncMysqlConnector implements ConnectorInterface
9
9
{
10
10
11
- protected static $ pool ;
11
+ protected static $ connectToPoll ;
12
12
13
13
public function connect ($ config )
14
14
{
15
15
16
- if (static ::$ pool ) {
17
- return static ::$ pool ;
16
+ if (isset ( static ::$ connectToPoll [ $ config [ ' name ' ]]) ) {
17
+ return static ::$ connectToPoll [ $ config [ ' name ' ]] ;
18
18
}
19
19
20
20
$ username = $ config ['username ' ];
@@ -27,7 +27,7 @@ public function connect($config)
27
27
}
28
28
$ database = $ config ['database ' ];
29
29
30
- return static ::$ pool = new Pool (
30
+ return static ::$ connectToPoll [ $ config [ ' name ' ]] = new Pool (
31
31
$ username . ': ' . $ password . '@ ' . $ host . '/ ' . $ database . '?charset= ' . $ charset .'&idle= ' .($ config ['idle ' ] ?? 30 ),
32
32
$ config ['pool ' ]['min_connections ' ] ?? 1 ,
33
33
$ config ['pool ' ]['max_connections ' ] ?? 10 ,
You can’t perform that action at this time.
0 commit comments