‪TYPO3CMS  ‪main
TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService Class Reference

Public Member Functions

 __construct (private readonly ConfigurationManager $configurationManager)
 
 execute ()
 

Protected Member Functions

 throwConfigurationChangedException ()
 
 removeObsoleteLocalConfigurationSettings ()
 
 generateEncryptionKeyIfNeeded ()
 
 transferHttpSettings ()
 
 disableImageMagickDetailSettingsIfImageMagickIsDisabled ()
 
 setImageMagickDetailSettings ()
 
 migrateImageProcessorSetting ()
 
 migrateLockSslSetting ()
 
 migrateDatabaseConnectionSettings ()
 
 migrateDatabaseConnectionCharset ()
 
 migrateDatabaseDriverOptions ()
 
 migrateCacheHashOptions ()
 
 migrateExceptionErrors ()
 
 migrateDisplayErrorsSetting ()
 
 migrateSaltedPasswordsSettings ()
 
 migrateCachingFrameworkCaches ()
 
 migrateMailSettingsToSendmail ()
 
 migrateMailSmtpEncryptSetting ()
 
 migrateVersionNumberInFileNameSetting ()
 
 removeDefaultColorspaceSettings ()
 

Protected Attributes

array $obsoleteLocalConfigurationSettings
 

Detailed Description

Execute "silent" LocalConfiguration upgrades if needed.

Some LocalConfiguration settings are obsolete or changed over time. This class handles upgrades of these settings. It is called by the step controller at an early point.

Every change is encapsulated in one method and must throw a ConfigurationChangedException if new data is written to LocalConfiguration. This is caught by above step controller to initiate a redirect and start again with adapted configuration.

This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.

Definition at line 44 of file SilentConfigurationUpgradeService.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::__construct ( private readonly ConfigurationManager  $configurationManager)

Definition at line 203 of file SilentConfigurationUpgradeService.php.

Member Function Documentation

◆ disableImageMagickDetailSettingsIfImageMagickIsDisabled()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::disableImageMagickDetailSettingsIfImageMagickIsDisabled ( )
protected

Detail configuration of Image Magick settings must be cleared if Image Magick handling is disabled.

"Configuration presets" in install tool is not type safe, so value comparisons here are not type safe too, to not trigger changes to LocalConfiguration again.

Exceptions
ConfigurationChangedException

Definition at line 497 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ execute()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::execute ( )

Executed configuration upgrades. Single upgrade methods must throw a ConfigurationChangedException if something was written to LocalConfiguration.

Exceptions
ConfigurationChangedException
SettingsWriteException

Definition at line 212 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\disableImageMagickDetailSettingsIfImageMagickIsDisabled(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\generateEncryptionKeyIfNeeded(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateCacheHashOptions(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateCachingFrameworkCaches(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateDatabaseConnectionCharset(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateDatabaseConnectionSettings(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateDatabaseDriverOptions(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateDisplayErrorsSetting(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateExceptionErrors(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateImageProcessorSetting(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateLockSslSetting(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateMailSettingsToSendmail(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateMailSmtpEncryptSetting(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateSaltedPasswordsSettings(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateVersionNumberInFileNameSetting(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\removeDefaultColorspaceSettings(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\removeObsoleteLocalConfigurationSettings(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\setImageMagickDetailSettings(), and TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\transferHttpSettings().

◆ generateEncryptionKeyIfNeeded()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::generateEncryptionKeyIfNeeded ( )
protected

The encryption key is crucial for securing form tokens and the whole TYPO3 link rendering later on. A random key is set here in LocalConfiguration if it does not exist yet. This might happen during upgrading and will happen during first install.

Exceptions
ConfigurationChangedException

Definition at line 276 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ migrateCacheHashOptions()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::migrateCacheHashOptions ( )
protected

Migrate single cache hash related options under "FE" into "FE/cacheHash"

Exceptions
ConfigurationChangedException

Definition at line 838 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ migrateCachingFrameworkCaches()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::migrateCachingFrameworkCaches ( )
protected

Renames all SYS[caching][cache] configuration names to names without the prefix "cache_". see #88366

Exceptions
ConfigurationChangedException

Definition at line 996 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Webhooks\Message\$identifier, and TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ migrateDatabaseConnectionCharset()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::migrateDatabaseConnectionCharset ( )
protected

Migrate the configuration setting DB/Connections/Default/charset to 'utf8' as 'utf-8' is not supported by all MySQL versions.

Exceptions
ConfigurationChangedException

Definition at line 796 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ migrateDatabaseConnectionSettings()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::migrateDatabaseConnectionSettings ( )
protected

Move the database connection settings to a "Default" connection

Exceptions
ConfigurationChangedException

Definition at line 674 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ migrateDatabaseDriverOptions()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::migrateDatabaseDriverOptions ( )
protected

Migrate the configuration setting DB/Connections/Default/driverOptions to array type.

Exceptions
ConfigurationChangedException

Definition at line 816 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ migrateDisplayErrorsSetting()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::migrateDisplayErrorsSetting ( )
protected

Migrate SYS/displayErrors to not contain 2

Exceptions
ConfigurationChangedException

Definition at line 919 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ migrateExceptionErrors()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::migrateExceptionErrors ( )
protected

Migrate SYS/exceptionalErrors to not contain E_USER_DEPRECATED

Exceptions
ConfigurationChangedException

Definition at line 899 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ migrateImageProcessorSetting()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::migrateImageProcessorSetting ( )
protected

Migrate the definition of the image processor from the configuration value im_version_5 to the setting processor.

Exceptions
ConfigurationChangedException

Definition at line 583 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ migrateLockSslSetting()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::migrateLockSslSetting ( )
protected

Migrate the configuration setting BE/lockSSL to boolean if set in the system/settings.php file

Exceptions
ConfigurationChangedException

Definition at line 655 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ migrateMailSettingsToSendmail()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::migrateMailSettingsToSendmail ( )
protected

Migrates "mail" to "sendmail" as "mail" (PHP's built-in mail() method) is not supported anymore with Symfony components. See #88643

Exceptions
ConfigurationChangedException

Definition at line 1027 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ migrateMailSmtpEncryptSetting()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::migrateMailSmtpEncryptSetting ( )
protected

Migrates MAIL/transport_smtp_encrypt to a boolean value See #91070, #90295, #88643 and https://github.com/symfony/symfony/commit/5b8c4676d059

Exceptions
ConfigurationChangedException

Definition at line 1048 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ migrateSaltedPasswordsSettings()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::migrateSaltedPasswordsSettings ( )
protected

Migrate salted passwords extension configuration settings to BE/passwordHashing and FE/passwordHashing

Exceptions
ConfigurationChangedException

Definition at line 939 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ migrateVersionNumberInFileNameSetting()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::migrateVersionNumberInFileNameSetting ( )
protected

Migrate [FE][versionNumberInFilename] to become a boolean flag

Exceptions
ConfigurationChangedException

Definition at line 1085 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ removeDefaultColorspaceSettings()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::removeDefaultColorspaceSettings ( )
protected

Remove the colorspace setting if it's already the recommended default for a given processor

Exceptions
ConfigurationChangedException

Definition at line 1109 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ removeObsoleteLocalConfigurationSettings()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::removeObsoleteLocalConfigurationSettings ( )
protected

Some settings in LocalConfiguration vanished in DefaultConfiguration and have no impact on the core anymore. To keep the configuration clean, those old settings are just silently removed from LocalConfiguration if set.

Exceptions
ConfigurationChangedException

Definition at line 258 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ setImageMagickDetailSettings()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::setImageMagickDetailSettings ( )
protected

Detail configuration of Image Magick and Graphics Magick settings depending on main values.

"Configuration presets" in install tool is not type safe, so value comparisons here are not type safe too, to not trigger changes to LocalConfiguration again.

Exceptions
ConfigurationChangedException

Definition at line 551 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

◆ throwConfigurationChangedException()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::throwConfigurationChangedException ( )
protected

Throw exception after configuration change to trigger a redirect.

Exceptions
ConfigurationChangedException

Definition at line 242 of file SilentConfigurationUpgradeService.php.

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\disableImageMagickDetailSettingsIfImageMagickIsDisabled(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\generateEncryptionKeyIfNeeded(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateCacheHashOptions(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateCachingFrameworkCaches(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateDatabaseConnectionCharset(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateDatabaseConnectionSettings(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateDatabaseDriverOptions(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateDisplayErrorsSetting(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateExceptionErrors(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateImageProcessorSetting(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateLockSslSetting(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateMailSettingsToSendmail(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateMailSmtpEncryptSetting(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateSaltedPasswordsSettings(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\migrateVersionNumberInFileNameSetting(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\removeDefaultColorspaceSettings(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\removeObsoleteLocalConfigurationSettings(), TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\setImageMagickDetailSettings(), and TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\transferHttpSettings().

◆ transferHttpSettings()

TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::transferHttpSettings ( )
protected

Parse old curl and HTTP options and set new HTTP options, related to Guzzle

Exceptions
ConfigurationChangedException

Definition at line 297 of file SilentConfigurationUpgradeService.php.

References TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\throwConfigurationChangedException().

Referenced by TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService\execute().

Member Data Documentation

◆ $obsoleteLocalConfigurationSettings

array TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::$obsoleteLocalConfigurationSettings
protected

List of obsolete configuration options in LocalConfiguration to be removed Example: // #forge-ticket 'BE/somesetting',

Definition at line 52 of file SilentConfigurationUpgradeService.php.