New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename the web
folder to public
#3084
Conversation
Don't we need to solve #2461 first? |
No:
It seems to work though. |
Maybe we should change this default (once and for all) in Contao 5 only? That would probably solve a lot of potential headaches (including the Contao Manager). |
We have already discussed this (see #1088 (comment)). |
ebd72e0
to
40c6b92
Compare
This PR is ready to merge. I have thoroughly tested the changes and made sure that the installation commands fall back to |
did you also test this with the Contao Manager? e.g. if it is possible to manage an installation that uses the |
The Contao Manager does not yet support anything but |
Does that mean you cannot manage Contao 4.12 with the Contao Manager? |
Of course not. 😄 You just have to use |
A problem would arise if you install the Contao Manager after installing Contao via |
if (null === $this->webDir) { | ||
if ((new Filesystem())->exists($this->projectDir.'/web')) { | ||
$this->webDir = 'web'; // backwards compatibility | ||
} else { | ||
$this->webDir = 'public'; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now testing this, I'm wondering why we do not just rely on the config value here? IMHO the config should be the single point of truth once configured.
I fear there is still something fishy with this change… 🐟 In an 4.12 installation where I did not configure anything, I think there is another problem with detecting the old default by checking if the (https://contao.slack.com/archives/CK4J0KNDB/p1629567427484400) |
It does work like a charm on contao.org, therefore I suggest you debug the problem and open a new issue if it turns out to be a Contao problem. |
I am also unable to confirm the problem. After running |
Ah I see what you mean now with deployments. That is indeed a problem, since this will break the live site after a deployment (because the deployment would not fail in that case). For our deployments it's not a problem since we usually have versioned files in the |
I think we can't auto detect the old state. Instead we IMHO should use a config key in the |
This PR renames the
web
folder topublic
as discussed here: #1088 (comment)@contao/developers How do we want to implement backwards compatibility? I see two options:
Add a check in the
Configuration
class: Ifcontao.web_dir
ispublic
and there is nopublic
folder but aweb
folder, change the value toweb
automatically.Make the
GenerateSymlinkCommand
generate a symlink frompublic
toweb
if aweb
folder exists.I am in favor of solution no. 1, because I find having two different public folders confusing. WDYT?