#107788Installing with SQLite writes a static string to settings.php
Description
The headache
Installing TYPO3 with sqlite, writes a static string to settings.php.
The filename is random and path is absolute in terms of the current server. For ddev this is for example
/var/www/html/var/sqlite/cms-2d481814.sqlite
The path can be different from production but with settings.php in version control, this is an issue.
Trying to override the path with additional.php
Adding
$GLOBALS[‘TYPO3_CONF_VARS’][‘DB’][‘Connections’][‘Default’][‘path’] = \TYPO3\CMS\Core\Core\Environment::getVarPath() . ‘/sqlite/database.sqlite’;
is respected after installation but not taken into account during installation. This leaves the installation with a random named sqlite file with tables, and a empty database.sqlite file.
Resume
additional.php is not taken into account at this point of installation and settings.php is overridden upon installation, so setting the value is not a solution
Instructions
Running the following command (via ddev) for setting up a new site
ddev typo3 setup --driver=sqlite --admin-username admin --admin-user-password=Passw0rd! --admin-email=john.doe@example.org --server-type=other --project-name="SQLite installed TYPO3" --create-site=no --force
Install TYPO3 with sqlite and get’s a static path set to settings.php
Proposed solutions and brainstorm
- “path” being relative to the projectDir
- A env named “TYPO3_DB_PATH”
I cheer for the path being relative to projectDir
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[BUGFIX] Installing with SQLite writes a static string to settings.php Resolves: #107788 Releases: main