File tree 2 files changed +49
-1
lines changed
2 files changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,8 @@ public static function create(
58
58
AbstractPlatform $ platform ,
59
59
?ConnectionOptions $ options = null
60
60
): Connection {
61
- $ numberOfConnections = ConnectionPoolOptions::DEFAULT_NUMBER_OF_CONNECTIONS ;
61
+ $ numberOfConnections = $ credentials ->getConnections () ??
62
+ ConnectionPoolOptions::DEFAULT_NUMBER_OF_CONNECTIONS ;
62
63
if ($ options instanceof ConnectionPoolOptions) {
63
64
$ numberOfConnections = $ options ->getNumberOfConnections ();
64
65
}
Original file line number Diff line number Diff line change @@ -26,6 +26,18 @@ class Credentials
26
26
private string $ password ;
27
27
private string $ dbName ;
28
28
29
+ /**
30
+ * @deprecated
31
+ * @var array options
32
+ */
33
+ private array $ options ;
34
+
35
+ /**
36
+ * @deprecated
37
+ * @var int|null $connections
38
+ */
39
+ private ?int $ connections = null ;
40
+
29
41
/**
30
42
* Credentials constructor.
31
43
*
@@ -47,6 +59,23 @@ public function __construct(
47
59
$ this ->user = $ user ;
48
60
$ this ->password = $ password ;
49
61
$ this ->dbName = $ dbName ;
62
+
63
+ if (func_num_args () > 5 ) {
64
+ trigger_error (
65
+ '6th argument is deprecated, for options please use ' . ConnectionOptions::class .
66
+ ' or and extend of this class instead, when creating a connection ' ,
67
+ E_USER_DEPRECATED
68
+ );
69
+ $ this ->options = (array )func_get_arg (5 );
70
+ }
71
+ if (func_num_args () > 6 ) {
72
+ trigger_error (
73
+ '7th argument is deprecated, please use ' . ConnectionPoolOptions::class .
74
+ ' to set the number of connections, when creating a ' . ConnectionPool::class,
75
+ E_USER_DEPRECATED
76
+ );
77
+ $ this ->connections = (int )func_get_arg (6 );
78
+ }
50
79
}
51
80
52
81
/**
@@ -89,6 +118,24 @@ public function getDbName(): string
89
118
return $ this ->dbName ;
90
119
}
91
120
121
+ /**
122
+ * @deprecated
123
+ * @return array
124
+ */
125
+ public function getOptions (): array
126
+ {
127
+ return $ this ->options ;
128
+ }
129
+
130
+ /**
131
+ * @deprecated
132
+ * @return int|null
133
+ */
134
+ public function getConnections (): ?int
135
+ {
136
+ return $ this ->connections ;
137
+ }
138
+
92
139
/**
93
140
* To string.
94
141
*/
You can’t perform that action at this time.
0 commit comments