Skip to content

Commit

Permalink
[TASK] Access env variables via $_ENV
Browse files Browse the repository at this point in the history
getenv() is not supported with dotenv createMutable()
  • Loading branch information
bnf committed Apr 6, 2024
1 parent 5bd1b5e commit 479b64d
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions config/system/additional.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,38 @@

$GLOBALS['TYPO3_CONF_VARS'] = array_replace_recursive($GLOBALS['TYPO3_CONF_VARS'], [
'BE' => [
'debug' => getenv('TYPO3_BE_DEBUG') ?: 0,
'installToolPassword' => getenv('TYPO3_BE_INSTALLTOOLPASSWORD') ?: '',
'debug' => $_ENV['TYPO3_BE_DEBUG'] ?? 0,
'installToolPassword' => $_ENV['TYPO3_BE_INSTALLTOOLPASSWORD'] ?? '',
],
'FE' => [
'debug' => getenv('TYPO3_FE_DEBUG') ?: 0,
'debug' => $_ENV['TYPO3_FE_DEBUG'] ?? 0,
],
'DB' => [
'Connections' => [
'Default' => [
'host' => getenv('TYPO3_DB_CONNECTIONS_DEFAULT_HOST'),
'port' => (int)(getenv('TYPO3_DB_CONNECTIONS_DEFAULT_PORT') ?: 3306),
'user' => getenv('TYPO3_DB_CONNECTIONS_DEFAULT_USER'),
'password' => getenv('TYPO3_DB_CONNECTIONS_DEFAULT_PASSWORD'),
'dbname' => getenv('TYPO3_DB_CONNECTIONS_DEFAULT_DBNAME'),
'host' => $_ENV['TYPO3_DB_CONNECTIONS_DEFAULT_HOST'],
'port' => (int)($_ENV['TYPO3_DB_CONNECTIONS_DEFAULT_PORT'] ?? 3306),
'user' => $_ENV['TYPO3_DB_CONNECTIONS_DEFAULT_USER'],
'password' => $_ENV['TYPO3_DB_CONNECTIONS_DEFAULT_PASSWORD'],
'dbname' => $_ENV['TYPO3_DB_CONNECTIONS_DEFAULT_DBNAME'],
],
],
],
'MAIL' => [
'defaultMailFromAddress' => getenv('TYPO3_MAIL_DEFAULTMAILFROMADDRESS') ?: '',
'defaultMailFromName' => getenv('TYPO3_MAIL_DEFAULTMAILFROMNAME') ?: '',
'transport' => getenv('TYPO3_MAIL_TRANSPORT'),
'transport_mbox_file' => getenv('TYPO3_MAIL_TRANSPORT_MBOX_FILE'),
'transport_sendmail_command' => getenv('TYPO3_MAIL_TRANSPORT_SENDMAIL_COMMAND'),
'transport_smtp_encrypt' => getenv('TYPO3_MAIL_TRANSPORT_SMTP_ENCRYPT'),
'transport_smtp_password' => getenv('TYPO3_MAIL_TRANSPORT_SMTP_PASSWORD'),
'transport_smtp_server' => getenv('TYPO3_MAIL_TRANSPORT_SMTP_SERVER'),
'transport_smtp_username' => getenv('TYPO3_MAIL_TRANSPORT_SMTP_USERNAME'),
'defaultMailFromAddress' => $_ENV['TYPO3_MAIL_DEFAULTMAILFROMADDRESS'] ?? '',
'defaultMailFromName' => $_ENV['TYPO3_MAIL_DEFAULTMAILFROMNAME'] ?? '',
'transport' => $_ENV['TYPO3_MAIL_TRANSPORT'],
'transport_mbox_file' => $_ENV['TYPO3_MAIL_TRANSPORT_MBOX_FILE'],
'transport_sendmail_command' => $_ENV['TYPO3_MAIL_TRANSPORT_SENDMAIL_COMMAND'],
'transport_smtp_encrypt' => $_ENV['TYPO3_MAIL_TRANSPORT_SMTP_ENCRYPT'],
'transport_smtp_password' => $_ENV['TYPO3_MAIL_TRANSPORT_SMTP_PASSWORD'],
'transport_smtp_server' => $_ENV['TYPO3_MAIL_TRANSPORT_SMTP_SERVER'],
'transport_smtp_username' => $_ENV['TYPO3_MAIL_TRANSPORT_SMTP_USERNAME'],
],
'SYS' => [
'devIPmask' => getenv('TYPO3_SYS_DEVIPMASK') ?: '',
'displayErrors' => getenv('TYPO3_SYS_DISPLAYERRORS') ?: 0,
'encryptionKey' => getenv('TYPO3_SYS_ENCRYPTIONKEY'),
'exceptionalErrors' => getenv('TYPO3_SYS_EXCEPTIONALERRORS') ?: 4096,
'devIPmask' => $_ENV['TYPO3_SYS_DEVIPMASK'] ?? '',
'displayErrors' => $_ENV['TYPO3_SYS_DISPLAYERRORS'] ?? 0,
'encryptionKey' => $_ENV['TYPO3_SYS_ENCRYPTIONKEY'],
'exceptionalErrors' => $_ENV['TYPO3_SYS_EXCEPTIONALERRORS'] ?? 4096,
],
]);

0 comments on commit 479b64d

Please sign in to comment.