From 5a6256324dced1e441d0c5bb825a0b3e09a38672 Mon Sep 17 00:00:00 2001 From: John Robinson Date: Tue, 10 Sep 2024 21:48:06 -0400 Subject: [PATCH] Fixed DbFactory bug --- CHANGELOG.md | 6 ++++++ src/DbFactory.php | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87c6fc4..bab88eb 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `Fixed` for any bug fixes. - `Security` in case of vulnerabilities +## [4.0.1] - 2024.09.10 + +### Fixed + +- Fixed bug in `DbFactory` using old namespace. + ## [4.0.0] - 2024.09.10 ### Added diff --git a/src/DbFactory.php b/src/DbFactory.php index ddf2686..55c2506 100644 --- a/src/DbFactory.php +++ b/src/DbFactory.php @@ -28,7 +28,7 @@ public static function create(array $array): Db // Check valid adapter - if (!isset($db_config['adapter']) || !class_exists('Bayfront\PDO\Adapters\\' . $db_config['adapter'])) { + if (!isset($db_config['adapter']) || !class_exists('Bayfront\SimplePdo\\Adapters\\' . $db_config['adapter'])) { throw new ConfigurationException('Invalid database configuration (' . $name . '): adapter not specified or does not exist'); @@ -36,15 +36,15 @@ public static function create(array $array): Db /** @var AdapterInterface $adapter */ - $adapter = 'Bayfront\PDO\Adapters\\' . $db_config['adapter']; + $adapter = 'Bayfront\SimplePdo\Adapters\\' . $db_config['adapter']; if (isset($db_config['default']) && true === $db_config['default'] && !isset($db)) { // If default database // Create connection /* - * @throws Bayfront\PDO\Exceptions\ConfigurationException - * @throws Bayfront\PDO\Exceptions\UnableToConnectException + * @throws Bayfront\SimplePdo\Exceptions\ConfigurationException + * @throws Bayfront\SimplePdo\Exceptions\UnableToConnectException */ $pdo = $adapter::connect($db_config); @@ -58,7 +58,7 @@ public static function create(array $array): Db // Create connection /* - * @throws Bayfront\PDO\Exceptions\PdoException + * @throws Bayfront\SimplePdo\Exceptions\PdoException */ $connections[$name] = $adapter::connect($db_config); @@ -76,7 +76,7 @@ public static function create(array $array): Db foreach ($connections as $name => $pdo) { /* - * @throws Bayfront\PDO\Exceptions\InvalidDatabaseException + * @throws Bayfront\SimplePdo\Exceptions\InvalidDatabaseException */ $db->addConnection($pdo, $name); // Add all additional connections