From 87f252fa130b845d7b1149471df6b5020029a4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Vlk?= Date: Sun, 16 Aug 2020 01:22:25 +0200 Subject: [PATCH] fix connecting to database when registering package --- src/Connectors/ConnectionFactory.php | 5 +++-- src/PostgisConnection.php | 9 --------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/Connectors/ConnectionFactory.php b/src/Connectors/ConnectionFactory.php index 99b9beb..7585b27 100644 --- a/src/Connectors/ConnectionFactory.php +++ b/src/Connectors/ConnectionFactory.php @@ -1,5 +1,6 @@ container->bound($key = "db.connection.{$driver}")) { - return $this->container->make($key, [$connection, $database, $prefix, $config]); + if ($resolver = Connection::getResolver($driver)) { + return $resolver($connection, $database, $prefix, $config); } if ($driver === 'pgsql') { diff --git a/src/PostgisConnection.php b/src/PostgisConnection.php index 746feb0..6696bb1 100644 --- a/src/PostgisConnection.php +++ b/src/PostgisConnection.php @@ -7,15 +7,6 @@ class PostgisConnection extends PostgresConnection { - public function __construct($pdo, $database = '', $tablePrefix = '', array $config = []) - { - parent::__construct($pdo, $database, $tablePrefix, $config); - - // Prevent geography type fields from throwing a 'type not found' error. - $this->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('geography', 'string'); - $this->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('geometry', 'string'); - } - /** * Get the default schema grammar instance. *