File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 6
6
use Doctrine \DBAL \Driver \AbstractPostgreSQLDriver ;
7
7
use Doctrine \DBAL \DriverManager ;
8
8
use Doctrine \DBAL \Exception ;
9
+ use Doctrine \DBAL \Tools \DsnParser ;
9
10
use Doctrine \ORM \EntityManagerInterface ;
10
11
use Doctrine \ORM \Tools \SchemaTool ;
11
12
use Hakam \MultiTenancyBundle \Doctrine \ORM \TenantEntityManager ;
@@ -41,12 +42,9 @@ public function __construct(
41
42
*/
42
43
public function createDatabase (string $ dbName ): int
43
44
{
44
- $ params = [
45
- "url " => $ this ->dbCredentials ['db_url ' ],
46
- ];
47
45
48
- // Override the dbname without preferred dbname
49
- $ tmpConnection = DriverManager::getConnection ($ params );
46
+ $ dsnParser = new DsnParser ([ ' mysql ' => ' pdo_mysql ' ]);
47
+ $ tmpConnection = DriverManager::getConnection ($ dsnParser -> parse ( $ this -> dbCredentials [ ' db_url ' ]) );
50
48
51
49
$ platform = $ tmpConnection ->getDatabasePlatform ();
52
50
if ($ tmpConnection ->getDriver () instanceof AbstractMySQLDriver || $ tmpConnection ->getDriver () instanceof AbstractPostgreSQLDriver) {
You can’t perform that action at this time.
0 commit comments