This commit is contained in:
Bozhidar 2024-05-10 22:38:25 +03:00
parent dcb8e26596
commit aa1c45a202
2 changed files with 5 additions and 4 deletions

View file

@ -61,11 +61,12 @@ class Database extends Model
} else {
$universalDatabaseExecutor = new UniversalDatabaseExecutor(
PhyreConfig::get('MYSQL_HOST'),
PhyreConfig::get('MYSQL_PORT'),
PhyreConfig::get('MYSQL_HOST', '127.0.0.1'),
PhyreConfig::get('MYSQL_PORT', 3306),
PhyreConfig::get('MYSQL_ROOT_USERNAME'),
PhyreConfig::get('MYSQL_ROOT_PASSWORD'),
);
$createDatabase = $universalDatabaseExecutor->createDatabase($databaseName);
if (isset($createDatabase['error'])) {
throw new \Exception($createDatabase['message']);

View file

@ -57,8 +57,8 @@ class DatabaseUser extends Model
}
} else {
$universalDatabaseExecutor = new UniversalDatabaseExecutor(
PhyreConfig::get('MYSQL_HOST'),
PhyreConfig::get('MYSQL_PORT'),
PhyreConfig::get('MYSQL_HOST', '127.0.0.1'),
PhyreConfig::get('MYSQL_PORT', 3306),
PhyreConfig::get('MYSQL_ROOT_USERNAME'),
PhyreConfig::get('MYSQL_ROOT_PASSWORD'),
$findDatabase->database_name_prefix . $findDatabase->database_name