File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ services:
2929 - STOMP_DSN=stomp://guest:guest@rabbitmq:61613/mqdev
3030 - RABITMQ_STOMP_DSN=stomp+rabbitmq://guest:guest@rabbitmq:61613/mqdev
3131 - RABBITMQ_MANAGMENT_DSN=http://guest:guest@rabbitmq:15672/mqdev
32- - DOCTRINE_DSN=mysql ://root:rootpass@mysql/mqdev
32+ - DOCTRINE_DSN=pdo_mysql ://root:rootpass@mysql/mqdev
3333 - DOCTRINE_POSTGRES_DSN=postgres://postgres:pass@postgres/template1
3434 - MYSQL_DSN=mysql://root:rootpass@mysql/mqdev
3535 - POSTGRES_DSN=postgres://postgres:pass@postgres/postgres
Original file line number Diff line number Diff line change @@ -86,7 +86,16 @@ private function establishConnection(): Connection
8686 {
8787 if (false == $ this ->connection ) {
8888 $ this ->connection = DriverManager::getConnection ($ this ->config ['connection ' ]);
89- $ this ->connection ->getServerVersion (); // calls connect() internally
89+ if (
90+ method_exists ($ this ->connection , 'connect ' )
91+ && (new \ReflectionMethod ($ this ->connection , 'connect ' ))->isPublic ()
92+ ) {
93+ // DBAL < 4
94+ $ this ->connection ->connect ();
95+ } else {
96+ // DBAL >= 4
97+ $ this ->connection ->getServerVersion (); // calls connect() internally
98+ }
9099 }
91100
92101 return $ this ->connection ;
You can’t perform that action at this time.
0 commit comments