set sql_mode to disable STRICT_MODE usage for froxlor, thx to albech for the hint

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2017-11-08 07:49:40 +01:00
parent dd3e5e9c6b
commit 1e03946df7
3 changed files with 5 additions and 5 deletions

View File

@@ -204,7 +204,7 @@ class FroxlorInstall
$content .= $this->_status_message('begin', $this->_lng['install']['testing_mysql']); $content .= $this->_status_message('begin', $this->_lng['install']['testing_mysql']);
$options = array( $options = array(
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'set names utf8' 'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8,sql_mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'
); );
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";"; $dsn = "mysql:host=" . $this->_data['mysql_host'] . ";";
$fatal_fail = false; $fatal_fail = false;
@@ -240,7 +240,7 @@ class FroxlorInstall
$content .= $this->_importDatabaseData(); $content .= $this->_importDatabaseData();
// create DB object for new database // create DB object for new database
$options = array( $options = array(
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'set names utf8' 'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8,sql_mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'
); );
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";"; $dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";";
$another_fail = false; $another_fail = false;
@@ -511,7 +511,7 @@ 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']);
$options = array( $options = array(
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'set names utf8' 'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8,sql_mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'
); );
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";"; $dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";";
$fatal_fail = false; $fatal_fail = false;

View File

@@ -262,7 +262,7 @@ class Database {
// build up connection string // build up connection string
$driver = 'mysql'; $driver = 'mysql';
$dsn = $driver.":"; $dsn = $driver.":";
$options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'set names utf8'); $options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET names utf8,sql_mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"');
$attributes = array('ATTR_ERRMODE' => 'ERRMODE_EXCEPTION'); $attributes = array('ATTR_ERRMODE' => 'ERRMODE_EXCEPTION');
$dbconf["dsn"] = array( $dbconf["dsn"] = array(

View File

@@ -227,7 +227,7 @@ class pdns extends DnsBase
// build up connection string // build up connection string
$driver = 'mysql'; $driver = 'mysql';
$dsn = $driver.":"; $dsn = $driver.":";
$options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'set names utf8'); $options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET names utf8,sql_mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"');
$attributes = array('ATTR_ERRMODE' => 'ERRMODE_EXCEPTION'); $attributes = array('ATTR_ERRMODE' => 'ERRMODE_EXCEPTION');
$dbconf = array(); $dbconf = array();