From 4b3d0a27b6d3671dfc0555fd5e6f2d64cc087f5a Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Mon, 2 Oct 2017 10:00:16 +0200
Subject: [PATCH] [FOLLOWUP][TASK] Remove migrated
 TYPO3_CONF_VARS/SYS/setDBinit

This patch removes the obsolete "setDBinit" option which was migrated
in TYPO3 v8.

Resolves: #82421
Releases: master
Change-Id: I96477e4dd7e151bf74caeafa7bdc38a1cde2f484
Reviewed-on: https://review.typo3.org/54255
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
---
 typo3/sysext/core/Configuration/DefaultConfiguration.php     | 1 -
 .../core/Configuration/DefaultConfigurationDescription.yaml  | 3 ---
 ...reaking-82421-DroppedOldDBRelatedConfigurationOptions.rst | 1 +
 .../Classes/Service/SilentConfigurationUpgradeService.php    | 1 +
 .../SystemEnvironment/DatabasePlatform/MySqlCheck.php        | 2 +-
 .../ExtensionScanner/Php/ArrayDimensionMatcher.php           | 5 +++++
 6 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/typo3/sysext/core/Configuration/DefaultConfiguration.php b/typo3/sysext/core/Configuration/DefaultConfiguration.php
index 818ff56f3696..2eb7f92b3178 100644
--- a/typo3/sysext/core/Configuration/DefaultConfiguration.php
+++ b/typo3/sysext/core/Configuration/DefaultConfiguration.php
@@ -87,7 +87,6 @@ return [
         'mediafile_ext' => 'gif,jpg,jpeg,bmp,png,pdf,svg,ai,mp3,wav,mp4,ogg,flac,opus,webm,youtube,vimeo',
         'binPath' => '',
         'binSetup' => '',
-        'setDBinit' => '',
         'setMemoryLimit' => 0,
         'phpTimeZone' => '',
         'systemLog' => false,
diff --git a/typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml b/typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml
index 0bfe8bd8d284..66f1dede20a9 100644
--- a/typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml
+++ b/typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml
@@ -135,9 +135,6 @@ SYS:
         binSetup:
             type: multiline
             description: 'List of programs (separated by newline or comma). By default programs will be searched in default paths and the special paths defined by <code>binPath</code>. When PHP has openbasedir enabled the programs can not be found and have to be configured here. Example: <code>perl=/usr/bin/perl,unzip=/usr/local/bin/unzip</code>'
-        setDBinit:
-            type: multiline
-            description: 'These commands are executed after the database connection was established. Hint: The previous default "SET NAMES utf8;" is not required any more and will be removed automatically if set!'
         setMemoryLimit:
             type: int
             description: 'Integer: memory_limit in MB: If more than 16, TYPO3 will try to use ini_set() to set the memory limit of PHP to the value. This works only if the function ini_set() is not disabled by your sysadmin.'
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-82421-DroppedOldDBRelatedConfigurationOptions.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-82421-DroppedOldDBRelatedConfigurationOptions.rst
index 02c1a261750e..d955f74dcb8b 100644
--- a/typo3/sysext/core/Documentation/Changelog/master/Breaking-82421-DroppedOldDBRelatedConfigurationOptions.rst
+++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-82421-DroppedOldDBRelatedConfigurationOptions.rst
@@ -13,6 +13,7 @@ Some configuration options related to pre-doctrine era have been removed
 from :php:`$GLOBALS['TYPO3_CONF_VARS']`:
 
 * `SYS/sqlDebug` - Obsolete since version 8, no substitution
+* `SYS/setDBinit` - Obsolete since core version 8 and migrated automatically
 * `SYS/no_pconnect` - Obsolete since core version 8 and migrated automatically
 * `SYS/dbClientCompress` - Obsolete since core version 8 and migrated automatically
 
diff --git a/typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php b/typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php
index 70648c6a592d..a5f98827efb7 100644
--- a/typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php
+++ b/typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php
@@ -105,6 +105,7 @@ class SilentConfigurationUpgradeService
         // #82421
         'SYS/sqlDebug',
         'SYS/no_pconnect',
+        'SYS/setDBinit',
         'SYS/dbClientCompress',
         // #82430
         'SYS/syslogErrorReporting',
diff --git a/typo3/sysext/install/Classes/SystemEnvironment/DatabasePlatform/MySqlCheck.php b/typo3/sysext/install/Classes/SystemEnvironment/DatabasePlatform/MySqlCheck.php
index 7cccd7d32d4b..40c0d37d3c85 100644
--- a/typo3/sysext/install/Classes/SystemEnvironment/DatabasePlatform/MySqlCheck.php
+++ b/typo3/sysext/install/Classes/SystemEnvironment/DatabasePlatform/MySqlCheck.php
@@ -89,7 +89,7 @@ class MySqlCheck implements CheckInterface
                     . ' ' . implode(', ', $detectedIncompatibleSqlModes) . '.'
                     . ' The listed modes are not compatible with TYPO3 CMS.'
                     . ' You have to change that setting in your MySQL environment'
-                    . ' or in $GLOBALS[\'TYPO3_CONF_VARS\'][\'SYS\'][\'setDBinit\']',
+                    . ' or in $GLOBALS[\'TYPO3_CONF_VARS\'][\'DB\'][\'Connections\'][\'Default\'][\'initCommands\']',
                 'Incompatible SQL modes found!',
                 FlashMessage::ERROR
             ));
diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php
index 507e3de57b9e..ea6be0896751 100644
--- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php
+++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php
@@ -39,6 +39,11 @@ return [
             'Breaking-82421-DroppedOldDBRelatedConfigurationOptions.rst',
         ],
     ],
+    '$GLOBALS[\'TYPO3_CONF_VARS\'][\'SYS\'][\'setDBinit\']' => [
+        'restFiles' => [
+            'Breaking-82421-DroppedOldDBRelatedConfigurationOptions.rst',
+        ],
+    ],
     '$GLOBALS[\'TYPO3_CONF_VARS\'][\'SYS\'][\'no_pconnect\']' => [
         'restFiles' => [
             'Breaking-82421-DroppedOldDBRelatedConfigurationOptions.rst',
-- 
GitLab