@@ -50,65 +50,6 @@ public function connect(array $config)
50
50
return $ connection ;
51
51
}
52
52
53
- /**
54
- * Set the connection transaction isolation level.
55
- *
56
- * @param \PDO $connection
57
- * @param array $config
58
- * @return void
59
- */
60
- protected function configureIsolationLevel ($ connection , array $ config )
61
- {
62
- if (isset ($ config ['isolation_level ' ])) {
63
- $ connection ->prepare ("set session characteristics as transaction isolation level {$ config ['isolation_level ' ]}" )->execute ();
64
- }
65
- }
66
-
67
- /**
68
- * Set the timezone on the connection.
69
- *
70
- * @param \PDO $connection
71
- * @param array $config
72
- * @return void
73
- */
74
- protected function configureTimezone ($ connection , array $ config )
75
- {
76
- if (isset ($ config ['timezone ' ])) {
77
- $ timezone = $ config ['timezone ' ];
78
-
79
- $ connection ->prepare ("set time zone ' {$ timezone }' " )->execute ();
80
- }
81
- }
82
-
83
- /**
84
- * Set the "search_path" on the database connection.
85
- *
86
- * @param \PDO $connection
87
- * @param array $config
88
- * @return void
89
- */
90
- protected function configureSearchPath ($ connection , $ config )
91
- {
92
- if (isset ($ config ['search_path ' ]) || isset ($ config ['schema ' ])) {
93
- $ searchPath = $ this ->quoteSearchPath (
94
- $ this ->parseSearchPath ($ config ['search_path ' ] ?? $ config ['schema ' ])
95
- );
96
-
97
- $ connection ->prepare ("set search_path to {$ searchPath }" )->execute ();
98
- }
99
- }
100
-
101
- /**
102
- * Format the search path for the DSN.
103
- *
104
- * @param array $searchPath
105
- * @return string
106
- */
107
- protected function quoteSearchPath ($ searchPath )
108
- {
109
- return count ($ searchPath ) === 1 ? '" ' .$ searchPath [0 ].'" ' : '" ' .implode ('", " ' , $ searchPath ).'" ' ;
110
- }
111
-
112
53
/**
113
54
* Create a DSN string from a configuration.
114
55
*
@@ -171,6 +112,65 @@ protected function addSslOptions($dsn, array $config)
171
112
return $ dsn ;
172
113
}
173
114
115
+ /**
116
+ * Set the connection transaction isolation level.
117
+ *
118
+ * @param \PDO $connection
119
+ * @param array $config
120
+ * @return void
121
+ */
122
+ protected function configureIsolationLevel ($ connection , array $ config )
123
+ {
124
+ if (isset ($ config ['isolation_level ' ])) {
125
+ $ connection ->prepare ("set session characteristics as transaction isolation level {$ config ['isolation_level ' ]}" )->execute ();
126
+ }
127
+ }
128
+
129
+ /**
130
+ * Set the timezone on the connection.
131
+ *
132
+ * @param \PDO $connection
133
+ * @param array $config
134
+ * @return void
135
+ */
136
+ protected function configureTimezone ($ connection , array $ config )
137
+ {
138
+ if (isset ($ config ['timezone ' ])) {
139
+ $ timezone = $ config ['timezone ' ];
140
+
141
+ $ connection ->prepare ("set time zone ' {$ timezone }' " )->execute ();
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Set the "search_path" on the database connection.
147
+ *
148
+ * @param \PDO $connection
149
+ * @param array $config
150
+ * @return void
151
+ */
152
+ protected function configureSearchPath ($ connection , $ config )
153
+ {
154
+ if (isset ($ config ['search_path ' ]) || isset ($ config ['schema ' ])) {
155
+ $ searchPath = $ this ->quoteSearchPath (
156
+ $ this ->parseSearchPath ($ config ['search_path ' ] ?? $ config ['schema ' ])
157
+ );
158
+
159
+ $ connection ->prepare ("set search_path to {$ searchPath }" )->execute ();
160
+ }
161
+ }
162
+
163
+ /**
164
+ * Format the search path for the DSN.
165
+ *
166
+ * @param array $searchPath
167
+ * @return string
168
+ */
169
+ protected function quoteSearchPath ($ searchPath )
170
+ {
171
+ return count ($ searchPath ) === 1 ? '" ' .$ searchPath [0 ].'" ' : '" ' .implode ('", " ' , $ searchPath ).'" ' ;
172
+ }
173
+
174
174
/**
175
175
* Configure the synchronous_commit setting.
176
176
*
0 commit comments