mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 17:25:26 +02:00
Merge branch 'ent-13115-Comprobar-versiones-de-MySQL-y-MR-de-Principal-e-Historico-antes-de-aplicar-UM' into 'develop'
check history db mysql version in update See merge request artica/pandorafms!7046
This commit is contained in:
commit
c714c3547e
@ -1498,6 +1498,45 @@ class Client
|
|||||||
if ($filepath !== null) {
|
if ($filepath !== null) {
|
||||||
include $filepath;
|
include $filepath;
|
||||||
|
|
||||||
|
if ((bool) $config['history_db_enabled'] === true) {
|
||||||
|
if (isset($config['history_db_connection']) === false
|
||||||
|
|| $config['history_db_connection'] === false
|
||||||
|
) {
|
||||||
|
ob_start();
|
||||||
|
$config['history_db_connection'] = db_connect(
|
||||||
|
$config['history_db_host'],
|
||||||
|
$config['history_db_name'],
|
||||||
|
$config['history_db_user'],
|
||||||
|
io_output_password($config['history_db_pass']),
|
||||||
|
$config['history_db_port'],
|
||||||
|
false
|
||||||
|
);
|
||||||
|
ob_get_clean();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($config['history_db_connection'] !== false) {
|
||||||
|
$curr_mysql_version_hist = @mysql_db_process_sql(
|
||||||
|
'SELECT VERSION() AS version',
|
||||||
|
'affected_rows',
|
||||||
|
$config['history_db_connection'],
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
$curr_mysql_version_hist = $curr_mysql_version_hist[0]['version'];
|
||||||
|
|
||||||
|
if (is_string($curr_mysql_version_hist) === true
|
||||||
|
&& empty($curr_mysql_version_hist) === false
|
||||||
|
) {
|
||||||
|
if (isset($mysql_version) === true
|
||||||
|
&& is_string($mysql_version) === true
|
||||||
|
&& $this->compareVersions($curr_mysql_version_hist, $mysql_version) < 0
|
||||||
|
) {
|
||||||
|
throw new \Exception('MySQL version (history database) >= '.$mysql_version.' is required');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$curr_php_version = phpversion();
|
$curr_php_version = phpversion();
|
||||||
$curr_mysql_version = db_get_value_sql('SELECT VERSION() AS version');
|
$curr_mysql_version = db_get_value_sql('SELECT VERSION() AS version');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user