Merge pull request #612 from foliengriller/install
Checks Mysql version only if no fatal error occured
This commit is contained in:
@@ -234,6 +234,8 @@ class FroxlorInstall
|
|||||||
$fatal_fail = true;
|
$fatal_fail = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $fatal_fail) {
|
||||||
$version_server = $db_root->getAttribute(PDO::ATTR_SERVER_VERSION);
|
$version_server = $db_root->getAttribute(PDO::ATTR_SERVER_VERSION);
|
||||||
$sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
$sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||||
if (version_compare($version_server, '8.0.11', '<')) {
|
if (version_compare($version_server, '8.0.11', '<')) {
|
||||||
@@ -241,8 +243,6 @@ class FroxlorInstall
|
|||||||
}
|
}
|
||||||
$db_root->exec('SET sql_mode = "'.$sql_mode.'"');
|
$db_root->exec('SET sql_mode = "'.$sql_mode.'"');
|
||||||
|
|
||||||
if (! $fatal_fail) {
|
|
||||||
|
|
||||||
// ok, if we are here, the database connection is up and running
|
// ok, if we are here, the database connection is up and running
|
||||||
$content .= $this->_status_message('green', "OK");
|
$content .= $this->_status_message('green', "OK");
|
||||||
// check for existing db and create backup if so
|
// check for existing db and create backup if so
|
||||||
@@ -531,11 +531,6 @@ class FroxlorInstall
|
|||||||
{
|
{
|
||||||
$content = "";
|
$content = "";
|
||||||
$content .= $this->_status_message('begin', $this->_lng['install']['testing_new_db']);
|
$content .= $this->_status_message('begin', $this->_lng['install']['testing_new_db']);
|
||||||
$version_server = PDO::getAttribute(PDO::ATTR_SERVER_VERSION);
|
|
||||||
$sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
|
||||||
if (version_compare($version_server, '8.0.11', '<')) {
|
|
||||||
$sql_mode .= ',NO_AUTO_CREATE_USER';
|
|
||||||
}
|
|
||||||
$options = array(
|
$options = array(
|
||||||
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8'
|
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8'
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user