-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Issues with switching to public as the default web root #3363
Comments
I don't think we should do any of this. Keep in mind that the logic only applies to the default value, therefore all of the problems mentioned above can be solved by adding |
So if I'm installing Contao in a Symfony environment where I set my web root via the |
related #3370 |
Yes. We have decided against using
That is indeed something that we could reconsider, although I don't think many users will run into the issue. Any ideas how to improve it? |
It wouldn't do any harm to support it now, would it? I'd read it once when parsing the config and only use the value if
Only trust the config key: the usage would then be consistent at least and would be easier to debug. The auto-detection could still be in there when parsing the config value. But like I said, I wouldn't try to detect folders at all. 🙈 |
As discussed in the Contao call on September 30th, we want to set |
see #3535 |
Description ----------- | Q | A | -----------------| --- | Fixed issues | Fixes #3363 | Docs PR or issue | - #3363 (comment) > As discussed in the Contao call on September 30th, we want to set contao.web_dir from extra.public-dir in the composer.json file and deprecate the parameter in the configuration tree. Commits ------- 1a199c0 read extra.public-dir from composer.json + deprecate contao.web-dir container config 253010a fix phpstan + tests 0b9dd32 restore unrelated changes 73745cd Merge branch '4.x' into feature/composer-web-dir 47fc78c CS 81ce2db CS
Description ----------- | Q | A | -----------------| --- | Fixed issues | Fixes #3363 | Docs PR or issue | - contao/contao#3363 (comment) > As discussed in the Contao call on September 30th, we want to set contao.web_dir from extra.public-dir in the composer.json file and deprecate the parameter in the configuration tree. Commits ------- 1a199c04 read extra.public-dir from composer.json + deprecate contao.web-dir container config 253010a8 fix phpstan + tests 0b9dd329 restore unrelated changes 73745cd2 Merge branch '4.x' into feature/composer-web-dir 47fc78c2 CS 81ce2db2 CS
Affected version(s)
Contao 4.12?
Description
Detecting the use of
web
as public directory by checking if the resource exists on the filesystem might lead to unwanted behavior, see #3084 (comment).I noticed the problem when creating a new project from a template/skeleton (now with 4.12):
web
as the web rootweb
, however, does not exist initially →public
gets created on installweb
directorypublic
as the web rootweb
exists and things break*)*) because the
contao.web_dir
config setting now differs from the actual web rootThe same thing will happen when deploying by copying a bare minimum and installing, i.e. without explicitly creating the web directory. There the website will stop working as no entry points will be at the expected location.
IMHO we should neither rely on the existence nor absence of the web directory but only on the config. I've also seen projects using
web
as their js/layout root. 🙈What about this strategy instead?
extra.public-dir
in the app'scomposer.json
to set the public dir like Symfony doesweb
unless configured otherwise viacomposer.json
(or config)public
via the 4.12 managed editioncomposer.json
, so that only new projects are affectedWe could then ultimately change the default in Contao 5 and remove the
composer.json
config key again (as a BC break).The text was updated successfully, but these errors were encountered: