Skip to content

EspoCRM – Open Source CRM Application

Install: Fix PDO driver check

Yuriidecfb797ca95
diff --git a/application/Espo/Core/Utils/SystemRequirements.php b/application/Espo/Core/Utils/SystemRequirements.php
index 7300a07eac..9675bd77ab 100644
--- a/application/Espo/Core/Utils/SystemRequirements.php
+++ b/application/Espo/Core/Utils/SystemRequirements.php
@@ -30,6 +30,7 @@
namespace Espo\Core\Utils;
use Espo\Core\ORM\DatabaseParamsFactory;
+use Espo\Core\Utils\Database\ConfigDataProvider;
use Espo\Core\Utils\Database\Helper as DatabaseHelper;
use Espo\Core\Utils\File\Manager as FileManager;
@@ -49,7 +50,8 @@ class SystemRequirements
private FileManager $fileManager,
private System $systemHelper,
private DatabaseHelper $databaseHelper,
- private DatabaseParamsFactory $databaseParamsFactory
+ private DatabaseParamsFactory $databaseParamsFactory,
+ private ConfigDataProvider $databaseConfig,
) {}
/**
@@ -137,7 +139,9 @@ class SystemRequirements
private function getPdoExtension(): ?string
{
- $platform = $this->config->get('database.platform') ?? self::PLATFORM_MYSQL;
+ $platform = $this->databaseConfig->getPlatform() ?:
+ $this->config->get('database.platform') ?:
+ self::PLATFORM_MYSQL;
return $this->pdoExtensionMap[$platform] ?? null;
}
diff --git a/install/core/actions/settingsTest.php b/install/core/actions/settingsTest.php
index aea57d9914..913119278a 100644
--- a/install/core/actions/settingsTest.php
+++ b/install/core/actions/settingsTest.php
@@ -34,7 +34,15 @@ $result = [
'errors' => [],
];
-$phpRequiredList = $installer->getSystemRequirementList('php', true);
+$allPostData = $postData->getAll();
+
+$platform = $allPostData['dbPlatform'] ?? 'Mysql';
+
+$phpRequiredList = $installer->getSystemRequirementList('php', true, [
+ 'databaseParams' => [
+ 'platform' => $platform,
+ ]
+]);
foreach ($phpRequiredList as $name => $details) {
if (!$details['acceptable']) {
@@ -55,7 +63,7 @@ foreach ($phpRequiredList as $name => $details) {
}
}
-$allPostData = $postData->getAll();
+
if (
$result['success'] &&
@@ -80,8 +88,6 @@ if (
$port = null;
}
- $platform = $allPostData['dbPlatform'] ?? 'Mysql';
-
$databaseParams = [
'platform' => $platform,
'host' => $hostName,
diff --git a/install/core/i18n/en_US/install.json b/install/core/i18n/en_US/install.json
index f7f627dfb9..08a9c3769f 100644
--- a/install/core/i18n/en_US/install.json
+++ b/install/core/i18n/en_US/install.json
@@ -33,7 +33,7 @@
"Re-check": "Re-check",
"Version": "Version",
"Test settings": "Test Connection",
- "Database Settings Description": "Enter your MySQL database connection information (hostname, username and password). You can specify the server port for hostname like localhost:3306.",
+ "Database Settings Description": "Enter your database connection information. You can specify the server port for hostname, for example `localhost:3306`.",
"Install": "Install",
"SetupConfirmation page title": "System Requirements",
"PHP Configuration": "PHP settings",