diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c359bc..1a7ab27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## [1.2.2] +* fix bugs in database config + ## [1.2.1] * removed use swoole PDOConfig OR mysql_pdo * fix bug hostname in database config diff --git a/composer.json b/composer.json index 48c5879..2f750b7 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "flux-eco/storage", "description": "Handling mysql databases with json based table schemas", - "version": "1.2.1", + "version": "1.2.2", "keywords": [ "flux-eco", "storage", diff --git a/src/Adapters/MySqlDatabase/MysqlDatabaseClient.php b/src/Adapters/MySqlDatabase/MysqlDatabaseClient.php index 2cbe697..81e97a4 100644 --- a/src/Adapters/MySqlDatabase/MysqlDatabaseClient.php +++ b/src/Adapters/MySqlDatabase/MysqlDatabaseClient.php @@ -40,7 +40,7 @@ public static function new( DatabaseConfig $databaseConfig ): self { - $databaseName = $databaseConfig->getDbname(); + $databaseName = $databaseConfig->getDatabase(); if (empty(static::$instances[$databaseName]) === true || empty(static::$instances[$databaseName][$tableName]) === true) { $dbAdapter = new Adapter($databaseConfig->toArray()); @@ -167,7 +167,7 @@ private function addColumns(array $columns, CreateTable $table): void final public function storageExists(Handlers\StorageExistsCommand $storageExistsCommand): bool { - $dataBaseName = $this->databaseConfig->getDbname(); + $dataBaseName = $this->databaseConfig->getDatabase(); $tableName = $storageExistsCommand->getTableName(); $dbAdapter = $this->dbAdapter; diff --git a/src/Core/Ports/Database/DatabaseConfig.php b/src/Core/Ports/Database/DatabaseConfig.php index e9c400c..a98f4b4 100644 --- a/src/Core/Ports/Database/DatabaseConfig.php +++ b/src/Core/Ports/Database/DatabaseConfig.php @@ -8,7 +8,7 @@ public function getDatabase() : string; public function getDriver() : string; - public function getHostName() : string; + public function getHostname() : string; public function getPassword() : string;