pdo_pgsql dependency

This commit is contained in:
Yuri Kuznetsov
2023-07-11 12:55:12 +03:00
parent 81f0b5ebe2
commit baa72e6f52
4 changed files with 39 additions and 8 deletions

View File

@@ -35,6 +35,15 @@ use Espo\Core\Utils\File\Manager as FileManager;
class SystemRequirements
{
private const PLATFORM_MYSQL = 'Mysql';
private const PLATFORM_POSTGRESQL = 'Postgresql';
/** @var array<string, string> */
private $pdoExtensionMap = [
self::PLATFORM_MYSQL => 'pdo_mysql',
self::PLATFORM_POSTGRESQL => 'pdo_pgsql',
];
public function __construct(
private Config $config,
private FileManager $fileManager,
@@ -100,7 +109,28 @@ class SystemRequirements
]);
}
return $this->getRequiredList('phpRequirements', $requiredList);
$list = $this->getRequiredList('phpRequirements', $requiredList);
$pdoExtension = $this->getPdoExtension();
if ($pdoExtension) {
$acceptable = $this->systemHelper->hasPhpExtension($pdoExtension);
$list[$pdoExtension] = [
'type' => 'lib',
'acceptable' => $acceptable,
'actual' => $acceptable ? 'On' : 'Off',
];
}
return $list;
}
private function getPdoExtension(): ?string
{
$platform = $this->config->get('database.platform') ?? self::PLATFORM_MYSQL;
return $this->pdoExtensionMap[$platform] ?? null;
}
/**

View File

@@ -6,7 +6,6 @@
"license": "GPL-3.0-only",
"require": {
"php": ">=8.0.2 <8.3.0",
"ext-pdo_mysql": "*",
"ext-openssl": "*",
"ext-json": "*",
"ext-zip": "*",
@@ -55,6 +54,8 @@
"phpstan/phpstan": "^1.8"
},
"suggest": {
"ext-pdo_mysql": "*",
"ext-pdo_pgsql": "*",
"ext-bcmath": "*",
"ext-zmq": "*",
"ext-ldap": "*",

10
package-lock.json generated
View File

@@ -19,7 +19,7 @@
"bootstrap": "^3.4.1",
"bootstrap-colorpicker": "^2.5.2",
"bootstrap-datepicker": "^1.9.0",
"bullbone": "github:yurikuzn/bull#1.2.7",
"bullbone": "github:yurikuzn/bull#1.2.8",
"cronstrue": "^1.114.0",
"cropper": "^0.7.9",
"devbridge-autocomplete": "^1.4.11",
@@ -2571,8 +2571,8 @@
}
},
"node_modules/bullbone": {
"version": "1.2.7",
"resolved": "git+ssh://git@github.com/yurikuzn/bull.git#eefc6142e1f8342a6d3dc55f37a4cd31b2f2b556",
"version": "1.2.8",
"resolved": "git+ssh://git@github.com/yurikuzn/bull.git#a8f3dd66036b405aee21b9ffc94fb7ef603f75d9",
"license": "MIT"
},
"node_modules/bytes": {
@@ -9082,8 +9082,8 @@
"dev": true
},
"bullbone": {
"version": "git+ssh://git@github.com/yurikuzn/bull.git#eefc6142e1f8342a6d3dc55f37a4cd31b2f2b556",
"from": "bullbone@github:yurikuzn/bull#1.2.7"
"version": "git+ssh://git@github.com/yurikuzn/bull.git#a8f3dd66036b405aee21b9ffc94fb7ef603f75d9",
"from": "bullbone@github:yurikuzn/bull#1.2.8"
},
"bytes": {
"version": "3.1.2",

View File

@@ -45,7 +45,7 @@
"bootstrap": "^3.4.1",
"bootstrap-colorpicker": "^2.5.2",
"bootstrap-datepicker": "^1.9.0",
"bullbone": "github:yurikuzn/bull#1.2.7",
"bullbone": "github:yurikuzn/bull#1.2.8",
"cronstrue": "^1.114.0",
"cropper": "^0.7.9",
"devbridge-autocomplete": "^1.4.11",