Open dennisameling opened 1 year ago
@mollux could you share your approach? Would be great if we can get this addressed!
I run into the same issue and tried to build a post-composer hook to symlink the local.php
from a shared/
folder in project-root (similar to the approach which Deployer does):
project-root
.ddev/
packages/
docroot/
app/
config/
local.php -> ../../../shared/config/local.php
media/ -> ../../../shared/media/
shared/
media/
config/
local.php
But because of lacking Composer insights, I was not able yet to bring this setup to life.
It would be great if this issue would be addressed in a generic/recommended way for every Mautic project-setup using composer.
@dennisameling @Moongazer in Mautic 5 this was addressed by splitting up application and local config (see https://github.com/mautic/mautic/pull/11561 for more details).
So in M5, when running composer commands, the ./config folder is not changed by default.
Consider a Mautic installation created as follows:
In the root directory, I have a
.gitignore
which is the default but with the following lines added:This is based on this recommendation to not check those files into Git (as I haven't modified them):
This is problematic when updating Mautic to the latest version (
composer update
). It removes/docroot/app/config/local.php
.Before
composer update
, thelocal.php
file in the folder tree below:After running
composer update
to update Mautic, the file is gone:I fixed it by storing
local.php
inconfig/local.php
(in the root of my Mautic installation) and pointing Mautic to that file throughpaths_local.php
as follows:The contents of
scaffold-files/paths_local.php
are as follows:This basically means that I can just store
local.php
in theconfig
folder in the root directory of my Mautic instance.Just wanted to report this here in case someone is running into the same issue. Curious to hear from others whether they have a better approach to this 👍🏼