1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 09:44:38 +02:00

Update to add removal of incompatible sql_mode settings when used with MySQL 5.7.0 and newer, per issue processwire/processwire-issues#28

This commit is contained in:
Ryan Cramer
2016-10-11 11:07:37 -04:00
parent cd71d45ef4
commit 6b64a480b8
3 changed files with 160 additions and 9 deletions

View File

@@ -820,6 +820,37 @@ $config->dbHost = '';
*/
$config->dbPort = 3306;
/**
* Database init command (PDO::MYSQL_ATTR_INIT_COMMAND)
*
* Note: Placeholder "{charset}" gets automatically replaced with $config->dbCharset.
*
* @var string
*
*/
$config->dbInitCommand = "SET NAMES '{charset}'";
/**
* Set or adjust SQL mode per MySQL version
*
* Array indexes are minimum MySQL version mode applies to. Array values are
* the names of the mode(s) to apply. If value is preceded with "remove:" the mode will
* be removed, or if preceded with "add:" the mode will be added. If neither is present
* then the mode will be set exactly as given. To specify more than one SQL mode for the
* value, separate them by commas (CSV). To specify multiple statements for the same
* version, separate them with a slash "/".
*
* ~~~~~
* array("5.7.0" => "remove:STRICT_TRANS_TABLES,ONLY_FULL_GROUP_BY/add:NO_ZERO_DATE")
* ~~~~~
*
* @var array
*
*/
$config->dbSqlModes = array(
"5.7.0" => "remove:STRICT_TRANS_TABLES,ONLY_FULL_GROUP_BY"
);
/**
* Optional DB socket config for sites that need it (for most you should exclude this)
*