Breaking: #110319 - Encryption key is checked before ext_localconf.php loading
See forge#110319
Description
\TYPO3\ verifies that
$GLOBALS is not empty and
throws a
\Runtime otherwise. This check has been moved to
run before the
ext_ files of all active extensions are
loaded. Previously it ran afterwards, and additionally after
$GLOBALS had been populated.
The encryption key is part of the system configuration and is used for security-relevant functionality. It must therefore be in place before any extension code is executed during bootstrap.
In addition,
$GLOBALS is now assigned after
Tca has been called, so consumers can not
observe a state where the global array is populated but the schema
information is not yet available.
Impact
Installations that set
$GLOBALS
from within an
ext_ file now run into the
"TYPO3 Encryption Key is empty" exception, as the check is executed before
the file is evaluated.
Code within
ext_ files can not rely on
$GLOBALS being available anymore - which was never a
guaranteed state, as
ext_ files are loaded before TCA
is built. This is unchanged, but the assignment now happens later within
the bootstrap.
Affected installations
Installations that populate the encryption key at runtime from an
ext_ file, for instance by reading it from an
environment variable or an external secret store.
Migration
Set the encryption key in the system configuration, either directly in
config/ or in
config/, both of which are evaluated before
the check:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] = getenv('TYPO3_ENCRYPTION_KEY');