File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -264,4 +264,24 @@ protected function splitHostFromPortAndSocket($host): array {
264264
265265 return $ params ;
266266 }
267+
268+ protected function forceConnectionStringOracle (array $ connectionParams ): array {
269+ // the driverOptions are unused in dbal and need to be mapped to the parameters
270+ if (isset ($ connectionParams ['driverOptions ' ])) {
271+ $ connectionParams = array_merge ($ connectionParams , $ connectionParams ['driverOptions ' ]);
272+ }
273+ $ host = $ connectionParams ['host ' ];
274+ $ port = $ connectionParams ['port ' ] ?? null ;
275+ $ dbName = $ connectionParams ['dbname ' ];
276+
277+ // we set the connect string as dbname and unset the host to coerce doctrine into using it as connect string
278+ if ($ host === '' ) {
279+ $ connectionParams ['dbname ' ] = $ dbName ; // use dbname as easy connect name
280+ } else {
281+ $ connectionParams ['dbname ' ] = '// ' . $ host . (!empty ($ port ) ? ": {$ port }" : '' ) . '/ ' . $ dbName ;
282+ }
283+ unset($ connectionParams ['host ' ]);
284+
285+ return $ connectionParams ;
286+ }
267287}
You can’t perform that action at this time.
0 commit comments