TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
SilentConfigurationUpgradeService.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Install\Service;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
22 
35 {
40 
50  // #72400
51  'BE/spriteIconGenerator_handler',
52  // #72417
53  'SYS/lockingMode',
54  // #72473
55  'FE/secureFormmail',
56  'FE/strictFormmail',
57  'FE/formmailMaxAttachmentSize',
58  // #72337
59  'SYS/t3lib_cs_utils',
60  'SYS/t3lib_cs_convMethod',
61  // #72604
62  'SYS/maxFileNameLength',
63  // #72602
64  'BE/unzip_path',
65  // #72615
66  'BE/notificationPrefix',
67  // #72616
68  'BE/XCLASS',
69  'FE/XCLASS',
70  // #43085
71  'GFX/image_processing',
72  // #70056
73  'SYS/curlUse',
74  'SYS/curlProxyNTLM',
75  'SYS/curlProxyServer',
76  'SYS/curlProxyTunnel',
77  'SYS/curlProxyUserPass',
78  'SYS/curlTimeout',
79  // #75355
80  'BE/niceFlexFormXMLtags',
81  'BE/compactFlexFormXML',
82  // #75625
83  'SYS/clearCacheSystem',
84  // #77411
85  'SYS/caching/cacheConfigurations/extbase_typo3dbbackend_tablecolumns',
86  // #77460
87  'SYS/caching/cacheConfigurations/extbase_typo3dbbackend_queries'
88  ];
89 
91  {
92  $this->configurationManager = $configurationManager ?: GeneralUtility::makeInstance(ConfigurationManager::class);
93  }
94 
101  public function execute()
102  {
106  $this->transferHttpSettings();
111  $this->migrateLockSslSetting();
114  }
115 
125  {
126  $removed = $this->configurationManager->removeLocalConfigurationKeysByPath($this->obsoleteLocalConfigurationSettings);
127 
128  // If something was changed: Trigger a reload to have new values in next request
129  if ($removed) {
130  $this->throwRedirectException();
131  }
132  }
133 
141  protected function configureBackendLoginSecurity()
142  {
143  $rsaauthLoaded = ExtensionManagementUtility::isLoaded('rsaauth');
144  try {
145  $currentLoginSecurityLevelValue = $this->configurationManager->getLocalConfigurationValueByPath('BE/loginSecurityLevel');
146  if ($rsaauthLoaded && $currentLoginSecurityLevelValue !== 'rsa') {
147  $this->configurationManager->setLocalConfigurationValueByPath('BE/loginSecurityLevel', 'rsa');
148  $this->throwRedirectException();
149  } elseif (!$rsaauthLoaded && $currentLoginSecurityLevelValue !== 'normal') {
150  $this->configurationManager->setLocalConfigurationValueByPath('BE/loginSecurityLevel', 'normal');
151  $this->throwRedirectException();
152  }
153  } catch (\RuntimeException $e) {
154  // If an exception is thrown, the value is not set in LocalConfiguration
155  $this->configurationManager->setLocalConfigurationValueByPath('BE/loginSecurityLevel',
156  $rsaauthLoaded ? 'rsa' : 'normal');
157  $this->throwRedirectException();
158  }
159  }
160 
169  protected function generateEncryptionKeyIfNeeded()
170  {
171  try {
172  $currentValue = $this->configurationManager->getLocalConfigurationValueByPath('SYS/encryptionKey');
173  } catch (\RuntimeException $e) {
174  // If an exception is thrown, the value is not set in LocalConfiguration
175  $currentValue = '';
176  }
177 
178  if (empty($currentValue)) {
179  $randomKey = GeneralUtility::makeInstance(Random::class)->generateRandomHexString(96);
180  $this->configurationManager->setLocalConfigurationValueByPath('SYS/encryptionKey', $randomKey);
181  $this->throwRedirectException();
182  }
183  }
184 
190  protected function transferHttpSettings()
191  {
192  $changed = false;
193  $newParameters = [];
194  $obsoleteParameters = [];
195 
196  // Remove / migrate options to new options
197  try {
198  // Check if the adapter option is set, if so, set it to the parameters that are obsolete
199  $this->configurationManager->getLocalConfigurationValueByPath('HTTP/adapter');
200  $obsoleteParameters[] = 'HTTP/adapter';
201  } catch (\RuntimeException $e) {
202  }
203  try {
204  $newParameters['HTTP/version'] = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/protocol_version');
205  $obsoleteParameters[] = 'HTTP/protocol_version';
206  } catch (\RuntimeException $e) {
207  }
208  try {
209  $this->configurationManager->getLocalConfigurationValueByPath('HTTP/ssl_verify_host');
210  $obsoleteParameters[] = 'HTTP/ssl_verify_host';
211  } catch (\RuntimeException $e) {
212  }
213  try {
214  $legacyUserAgent = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/userAgent');
215  $newParameters['HTTP/headers/User-Agent'] = $legacyUserAgent;
216  $obsoleteParameters[] = 'HTTP/userAgent';
217  } catch (\RuntimeException $e) {
218  }
219 
220  // Redirects
221  try {
222  $legacyFollowRedirects = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/follow_redirects');
223  $obsoleteParameters[] = 'HTTP/follow_redirects';
224  } catch (\RuntimeException $e) {
225  $legacyFollowRedirects = '';
226  }
227  try {
228  $legacyMaximumRedirects = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/max_redirects');
229  $obsoleteParameters[] = 'HTTP/max_redirects';
230  } catch (\RuntimeException $e) {
231  $legacyMaximumRedirects = '';
232  }
233  try {
234  $legacyStrictRedirects = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/strict_redirects');
235  $obsoleteParameters[] = 'HTTP/strict_redirects';
236  } catch (\RuntimeException $e) {
237  $legacyStrictRedirects = '';
238  }
239 
240  // Check if redirects have been disabled
241  if ($legacyFollowRedirects !== '' && (bool)$legacyFollowRedirects === false) {
242  $newParameters['HTTP/allow_redirects'] = false;
243  } elseif ($legacyMaximumRedirects !== '' || $legacyStrictRedirects !== '') {
244  $newParameters['HTTP/allow_redirects'] = [];
245  if ($legacyMaximumRedirects !== '' && (int)$legacyMaximumRedirects !== 5) {
246  $newParameters['HTTP/allow_redirects']['max'] = (int)$legacyMaximumRedirects;
247  }
248  if ($legacyStrictRedirects !== '' && (bool)$legacyStrictRedirects === true) {
249  $newParameters['HTTP/allow_redirects']['strict'] = true;
250  }
251  // defaults are used, no need to set the option in LocalConfiguration.php
252  if (empty($newParameters['HTTP/allow_redirects'])) {
253  unset($newParameters['HTTP/allow_redirects']);
254  }
255  }
256 
257  // Migrate Proxy settings
258  try {
259  // Currently without protocol or port
260  $legacyProxyHost = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/proxy_host');
261  $obsoleteParameters[] = 'HTTP/proxy_host';
262  } catch (\RuntimeException $e) {
263  $legacyProxyHost = '';
264  }
265  try {
266  $legacyProxyPort = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/proxy_port');
267  $obsoleteParameters[] = 'HTTP/proxy_port';
268  } catch (\RuntimeException $e) {
269  $legacyProxyPort = '';
270  }
271  try {
272  $legacyProxyUser = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/proxy_user');
273  $obsoleteParameters[] = 'HTTP/proxy_user';
274  } catch (\RuntimeException $e) {
275  $legacyProxyUser = '';
276  }
277  try {
278  $legacyProxyPassword = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/proxy_password');
279  $obsoleteParameters[] = 'HTTP/proxy_password';
280  } catch (\RuntimeException $e) {
281  $legacyProxyPassword = '';
282  }
283  // Auth Scheme: Basic, digest etc.
284  try {
285  $legacyProxyAuthScheme = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/proxy_auth_scheme');
286  $obsoleteParameters[] = 'HTTP/proxy_auth_scheme';
287  } catch (\RuntimeException $e) {
288  $legacyProxyAuthScheme = '';
289  }
290 
291  if ($legacyProxyHost !== '') {
292  $proxy = 'http://';
293  if ($legacyProxyAuthScheme !== '' && $legacyProxyUser !== '' && $legacyProxyPassword !== '') {
294  $proxy .= $legacyProxyUser . ':' . $legacyProxyPassword . '@';
295  }
296  $proxy .= $legacyProxyHost;
297  if ($legacyProxyPort !== '') {
298  $proxy .= ':' . $legacyProxyPort;
299  }
300  $newParameters['HTTP/proxy'] = $proxy;
301  }
302 
303  // Verify peers
304  // see http://docs.guzzlephp.org/en/latest/request-options.html#verify
305  try {
306  $legacySslVerifyPeer = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/ssl_verify_peer');
307  $obsoleteParameters[] = 'HTTP/ssl_verify_peer';
308  } catch (\RuntimeException $e) {
309  $legacySslVerifyPeer = '';
310  }
311 
312  // Directory holding multiple Certificate Authority files
313  try {
314  $legacySslCaPath = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/ssl_capath');
315  $obsoleteParameters[] = 'HTTP/ssl_capath';
316  } catch (\RuntimeException $e) {
317  $legacySslCaPath = '';
318  }
319  // Certificate Authority file to verify the peer with (use when ssl_verify_peer is TRUE)
320  try {
321  $legacySslCaFile = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/ssl_cafile');
322  $obsoleteParameters[] = 'HTTP/ssl_cafile';
323  } catch (\RuntimeException $e) {
324  $legacySslCaFile = '';
325  }
326  if ($legacySslVerifyPeer !== '') {
327  if ($legacySslCaFile !== '' && $legacySslCaPath !== '') {
328  $newParameters['HTTP/verify'] = $legacySslCaPath . $legacySslCaFile;
329  } elseif ((bool)$legacySslVerifyPeer === false) {
330  $newParameters['HTTP/verify'] = false;
331  }
332  }
333 
334  // SSL Key + Passphrase
335  // Name of a file containing local certificate
336  try {
337  $legacySslLocalCert = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/ssl_local_cert');
338  $obsoleteParameters[] = 'HTTP/ssl_local_cert';
339  } catch (\RuntimeException $e) {
340  $legacySslLocalCert = '';
341  }
342 
343  // Passphrase with which local certificate was encoded
344  try {
345  $legacySslPassphrase = $this->configurationManager->getLocalConfigurationValueByPath('HTTP/ssl_passphrase');
346  $obsoleteParameters[] = 'HTTP/ssl_passphrase';
347  } catch (\RuntimeException $e) {
348  $legacySslPassphrase = '';
349  }
350 
351  if ($legacySslLocalCert !== '') {
352  if ($legacySslPassphrase !== '') {
353  $newParameters['HTTP/ssl_key'] = [
354  $legacySslLocalCert,
355  $legacySslPassphrase
356  ];
357  } else {
358  $newParameters['HTTP/ssl_key'] = $legacySslLocalCert;
359  }
360  }
361 
362  // Update the LocalConfiguration file if obsolete parameters or new parameters are set
363  if (!empty($obsoleteParameters)) {
364  $this->configurationManager->removeLocalConfigurationKeysByPath($obsoleteParameters);
365  $changed = true;
366  }
367  if (!empty($newParameters)) {
368  $this->configurationManager->setLocalConfigurationValuesByPathValuePairs($newParameters);
369  $changed = true;
370  }
371  if ($changed) {
372  $this->throwRedirectException();
373  }
374  }
375 
387  {
388  $changedValues = [];
389  try {
390  $currentImValue = $this->configurationManager->getLocalConfigurationValueByPath('GFX/processor_enabled');
391  } catch (\RuntimeException $e) {
392  $currentImValue = $this->configurationManager->getDefaultConfigurationValueByPath('GFX/processor_enabled');
393  }
394 
395  try {
396  $currentImPathValue = $this->configurationManager->getLocalConfigurationValueByPath('GFX/processor_path');
397  } catch (\RuntimeException $e) {
398  $currentImPathValue = $this->configurationManager->getDefaultConfigurationValueByPath('GFX/processor_path');
399  }
400 
401  try {
402  $currentImPathLzwValue = $this->configurationManager->getLocalConfigurationValueByPath('GFX/processor_path_lzw');
403  } catch (\RuntimeException $e) {
404  $currentImPathLzwValue = $this->configurationManager->getDefaultConfigurationValueByPath('GFX/processor_path_lzw');
405  }
406 
407  try {
408  $currentImageFileExtValue = $this->configurationManager->getLocalConfigurationValueByPath('GFX/imagefile_ext');
409  } catch (\RuntimeException $e) {
410  $currentImageFileExtValue = $this->configurationManager->getDefaultConfigurationValueByPath('GFX/imagefile_ext');
411  }
412 
413  try {
414  $currentThumbnailsValue = $this->configurationManager->getLocalConfigurationValueByPath('GFX/thumbnails');
415  } catch (\RuntimeException $e) {
416  $currentThumbnailsValue = $this->configurationManager->getDefaultConfigurationValueByPath('GFX/thumbnails');
417  }
418 
419  if (!$currentImValue) {
420  if ($currentImPathValue != '') {
421  $changedValues['GFX/processor_path'] = '';
422  }
423  if ($currentImPathLzwValue != '') {
424  $changedValues['GFX/processor_path_lzw'] = '';
425  }
426  if ($currentImageFileExtValue !== 'gif,jpg,jpeg,png') {
427  $changedValues['GFX/imagefile_ext'] = 'gif,jpg,jpeg,png';
428  }
429  if ($currentThumbnailsValue != 0) {
430  $changedValues['GFX/thumbnails'] = 0;
431  }
432  }
433  if (!empty($changedValues)) {
434  $this->configurationManager->setLocalConfigurationValuesByPathValuePairs($changedValues);
435  $this->throwRedirectException();
436  }
437  }
438 
449  protected function setImageMagickDetailSettings()
450  {
451  $changedValues = [];
452  try {
453  $currentProcessorValue = $this->configurationManager->getLocalConfigurationValueByPath('GFX/processor');
454  } catch (\RuntimeException $e) {
455  $currentProcessorValue = $this->configurationManager->getDefaultConfigurationValueByPath('GFX/processor');
456  }
457 
458  try {
459  $currentProcessorMaskValue = $this->configurationManager->getLocalConfigurationValueByPath('GFX/processor_allowTemporaryMasksAsPng');
460  } catch (\RuntimeException $e) {
461  $currentProcessorMaskValue = $this->configurationManager->getDefaultConfigurationValueByPath('GFX/processor_allowTemporaryMasksAsPng');
462  }
463 
464  try {
465  $currentProcessorEffectsValue = $this->configurationManager->getLocalConfigurationValueByPath('GFX/processor_effects');
466  } catch (\RuntimeException $e) {
467  $currentProcessorEffectsValue = $this->configurationManager->getDefaultConfigurationValueByPath('GFX/processor_effects');
468  }
469 
470  if ((string)$currentProcessorValue !== '') {
471  if ($currentProcessorMaskValue != 0) {
472  $changedValues['GFX/processor_allowTemporaryMasksAsPng'] = 0;
473  }
474  if ($currentProcessorValue === 'GraphicsMagick') {
475  if ($currentProcessorEffectsValue != -1) {
476  $changedValues['GFX/processor_effects'] = -1;
477  }
478  }
479  }
480  if (!empty($changedValues)) {
481  $this->configurationManager->setLocalConfigurationValuesByPathValuePairs($changedValues);
482  $this->throwRedirectException();
483  }
484  }
485 
492  protected function migrateImageProcessorSetting()
493  {
494  $changedSettings = [];
495  $settingsToRename = [
496  'GFX/im' => 'GFX/processor_enabled',
497  'GFX/im_version_5' => 'GFX/processor',
498  'GFX/im_v5effects' => 'GFX/processor_effects',
499  'GFX/im_path' => 'GFX/processor_path',
500  'GFX/im_path_lzw' => 'GFX/processor_path_lzw',
501  'GFX/im_mask_temp_ext_gif' => 'GFX/processor_allowTemporaryMasksAsPng',
502  'GFX/im_noScaleUp' => 'GFX/processor_allowUpscaling',
503  'GFX/im_noFramePrepended' => 'GFX/processor_allowFrameSelection',
504  'GFX/im_stripProfileCommand' => 'GFX/processor_stripColorProfileCommand',
505  'GFX/im_useStripProfileByDefault' => 'GFX/processor_stripColorProfileByDefault',
506  'GFX/colorspace' => 'GFX/processor_colorspace',
507  ];
508 
509  foreach ($settingsToRename as $oldPath => $newPath) {
510  try {
511  $value = $this->configurationManager->getLocalConfigurationValueByPath($oldPath);
512  $this->configurationManager->setLocalConfigurationValueByPath($newPath, $value);
513  $changedSettings[$oldPath] = true;
514  } catch (\RuntimeException $e) {
515  // If an exception is thrown, the value is not set in LocalConfiguration
516  $changedSettings[$oldPath] = false;
517  }
518  }
519 
520  if (!empty($changedSettings['GFX/im_version_5'])) {
521  $currentProcessorValue = $this->configurationManager->getLocalConfigurationValueByPath('GFX/im_version_5');
522  $newProcessorValue = $currentProcessorValue === 'gm' ? 'GraphicsMagick' : 'ImageMagick';
523  $this->configurationManager->setLocalConfigurationValueByPath('GFX/processor', $newProcessorValue);
524  }
525 
526  if (!empty($changedSettings['GFX/im_noScaleUp'])) {
527  $currentProcessorValue = $this->configurationManager->getLocalConfigurationValueByPath('GFX/im_noScaleUp');
528  $newProcessorValue = !$currentProcessorValue;
529  $this->configurationManager->setLocalConfigurationValueByPath('GFX/processor_allowUpscaling',
530  $newProcessorValue);
531  }
532 
533  if (!empty($changedSettings['GFX/im_noFramePrepended'])) {
534  $currentProcessorValue = $this->configurationManager->getLocalConfigurationValueByPath('GFX/im_noFramePrepended');
535  $newProcessorValue = !$currentProcessorValue;
536  $this->configurationManager->setLocalConfigurationValueByPath('GFX/processor_allowFrameSelection',
537  $newProcessorValue);
538  }
539 
540  if (!empty($changedSettings['GFX/im_mask_temp_ext_gif'])) {
541  $currentProcessorValue = $this->configurationManager->getLocalConfigurationValueByPath('GFX/im_mask_temp_ext_gif');
542  $newProcessorValue = !$currentProcessorValue;
543  $this->configurationManager->setLocalConfigurationValueByPath('GFX/processor_allowTemporaryMasksAsPng',
544  $newProcessorValue);
545  }
546 
547  if (!empty(array_filter($changedSettings))) {
548  $this->configurationManager->removeLocalConfigurationKeysByPath(array_keys($changedSettings));
549  $this->throwRedirectException();
550  }
551  }
552 
558  protected function throwRedirectException()
559  {
560  throw new RedirectException(
561  'Configuration updated, reload needed',
562  1379024938
563  );
564  }
565 
571  protected function migrateThumbnailsPngSetting()
572  {
573  $changedValues = [];
574  try {
575  $currentThumbnailsPngValue = $this->configurationManager->getLocalConfigurationValueByPath('GFX/thumbnails_png');
576  } catch (\RuntimeException $e) {
577  $currentThumbnailsPngValue = $this->configurationManager->getDefaultConfigurationValueByPath('GFX/thumbnails_png');
578  }
579 
580  if (is_int($currentThumbnailsPngValue) && $currentThumbnailsPngValue > 0) {
581  $changedValues['GFX/thumbnails_png'] = true;
582  }
583  if (!empty($changedValues)) {
584  $this->configurationManager->setLocalConfigurationValuesByPathValuePairs($changedValues);
585  $this->throwRedirectException();
586  }
587  }
588 
594  protected function migrateLockSslSetting()
595  {
596  try {
597  $currentOption = $this->configurationManager->getLocalConfigurationValueByPath('BE/lockSSL');
598  // check if the current option is an integer/string and if it is active
599  if (!is_bool($currentOption) && (int)$currentOption > 0) {
600  $this->configurationManager->setLocalConfigurationValueByPath('BE/lockSSL', true);
601  $this->throwRedirectException();
602  }
603  } catch (\RuntimeException $e) {
604  // no change inside the LocalConfiguration.php found, so nothing needs to be modified
605  }
606  }
607 
614  {
615  $changedSettings = [];
616  $settingsToRename = [
617  'DB/username' => 'DB/Connections/Default/user',
618  'DB/password' => 'DB/Connections/Default/password',
619  'DB/host' => 'DB/Connections/Default/host',
620  'DB/port' => 'DB/Connections/Default/port',
621  'DB/socket' => 'DB/Connections/Default/unix_socket',
622  'DB/database' => 'DB/Connections/Default/dbname',
623  'SYS/setDBinit' => 'DB/Connections/Default/initCommands',
624  'SYS/no_pconnect' => 'DB/Connections/Default/persistentConnection',
625  'SYS/dbClientCompress' => 'DB/Connections/Default/driverOptions',
626 
627  ];
628 
629  $confManager = $this->configurationManager;
630 
631  foreach ($settingsToRename as $oldPath => $newPath) {
632  try {
633  $value = $confManager->getLocalConfigurationValueByPath($oldPath);
634  $confManager->setLocalConfigurationValueByPath($newPath, $value);
635  $changedSettings[$oldPath] = true;
636  } catch (\RuntimeException $e) {
637  // If an exception is thrown, the value is not set in LocalConfiguration
638  $changedSettings[$oldPath] = false;
639  }
640  }
641 
642  // Remove empty socket connects
643  if (!empty($changedSettings['DB/Connections/Default/unix_socket'])) {
644  $value = $confManager->getLocalConfigurationValueByPath('DB/Connections/Default/unix_socket');
645  if (empty($value)) {
646  $confManager->removeLocalConfigurationKeysByPath(array_keys('DB/Connections/Default/unix_socket'));
647  }
648  }
649 
650  // Convert the dbClientCompress flag to a mysqli driver option
651  if (!empty($changedSettings['DB/Connections/Default/driverOptions'])) {
652  $value = $confManager->getLocalConfigurationValueByPath('DB/Connections/Default/driverOptions');
653  $confManager->setLocalConfigurationValueByPath(
654  'DB/Connections/Default/driverOptions',
655  (bool)$value ? MYSQLI_CLIENT_COMPRESS : 0
656  );
657  }
658 
659  // Swap value as the semantics have changed
660  if (!empty($changedSettings['DB/Connections/Default/persistentConnection'])) {
661  $value = $confManager->getLocalConfigurationValueByPath('DB/Connections/Default/persistentConnection');
662  $confManager->setLocalConfigurationValueByPath(
663  'DB/Connections/Default/persistentConnection',
664  !$value
665  );
666  }
667 
668  // Set the utf-8 connection charset by default if no value has been provided yet
669  try {
670  $confManager->getLocalConfigurationValueByPath('DB/Connections/Default/charset');
671  } catch (\RuntimeException $e) {
672  $confManager->setLocalConfigurationValueByPath('DB/Connections/Default/charset', 'utf8');
673  }
674 
675  // Use the mysqli driver by default if no value has been provided yet
676  try {
677  $confManager->getLocalConfigurationValueByPath('DB/Connections/Default/driver');
678  } catch (\RuntimeException $e) {
679  $confManager->setLocalConfigurationValueByPath('DB/Connections/Default/driver', 'mysqli');
680  }
681 
682  if (!empty(array_filter($changedSettings))) {
683  $confManager->removeLocalConfigurationKeysByPath(array_keys($changedSettings));
684  $this->throwRedirectException();
685  }
686  }
687 
694  protected function migrateDatabaseConnectionCharset()
695  {
696  $confManager = $this->configurationManager;
697  try {
698  $driver = $confManager->getLocalConfigurationValueByPath('DB/Connections/Default/driver');
699  $charset = $confManager->getLocalConfigurationValueByPath('DB/Connections/Default/charset');
700  if (in_array($driver, ['mysqli', 'pdo_mysql', 'drizzle_pdo_mysql'], true) && $charset === 'utf-8') {
701  $confManager->setLocalConfigurationValueByPath('DB/Connections/Default/charset', 'utf8');
702  $this->throwRedirectException();
703  }
704  } catch (\RuntimeException $e) {
705  // no incompatible charset configuration found, so nothing needs to be modified
706  }
707  }
708 }
static makeInstance($className,...$constructorArguments)