-
Notifications
You must be signed in to change notification settings - Fork 2
Description
The variable db_databases is created during initialization:
deployer-typo3-database/deployer/default/set.php
Lines 43 to 70 in c68de63
| set('db_databases', | |
| [ | |
| 'database_default' => [ | |
| get('db_default'), | |
| function () { | |
| if (get('driver_typo3cms', false)) { | |
| return (new \SourceBroker\DeployerTypo3Database\Drivers\Typo3CmsDriver)->getDatabaseConfig(); | |
| } | |
| return !empty($_ENV['IS_DDEV_PROJECT']) ? get('db_ddev_database_config') : | |
| (new \SourceBroker\DeployerTypo3Database\Drivers\Typo3EnvDriver)->getDatabaseConfig( | |
| [ | |
| 'host' => 'TYPO3__DB__Connections__Default__host', | |
| 'port' => 'TYPO3__DB__Connections__Default__port', | |
| 'dbname' => 'TYPO3__DB__Connections__Default__dbname', | |
| 'user' => 'TYPO3__DB__Connections__Default__user', | |
| 'password' => 'TYPO3__DB__Connections__Default__password', | |
| 'ssl_key' => 'TYPO3__DB__Connections__Default__ssl_key', | |
| 'ssl_cert' => 'TYPO3__DB__Connections__Default__ssl_cert', | |
| 'ssl_ca' => 'TYPO3__DB__Connections__Default__ssl_ca', | |
| 'ssl_capath' => 'TYPO3__DB__Connections__Default__ssl_capath', | |
| 'ssl_cipher' => 'TYPO3__DB__Connections__Default__ssl_cipher', | |
| 'flags' => 'TYPO3__DB__Connections__Default__driverOptions__flags' | |
| ] | |
| ); | |
| } | |
| ] | |
| ] | |
| ); |
This means that any changes to the variables db_default or db_ddev_database_config are not reflected in db_databases.
Subsequently, the variable db_databases_merged suffers from the same issue.
This behavior is also only partially documented, showing only editing db_default is not enough and needs to be pushed into db_databases or a host configuration instead. However even that isn't enough, as the relevant changes must be applied to db_databases_merged directly.
Just like sourcebroker/deployer-extended-typo3 does it already:
$dbDatabaseMerged = get('db_databases_merged');
$dbDatabaseMerged['database_default']['ignore_tables_out'] = [
...$dbDatabaseMerged['database_default']['ignore_tables_out'],
'my_new_ignored_table'
];
set('db_databases_merged', $dbDatabaseMerged);An actual fix is populating db_databases and db_databases_merged only after the whole deployer setup has been read or accessing the original source for each setting directly instead of relying on "a snapshot of the past"...