Drupal-project: use public not web as the web root

Created on 20 Dec 2018  路  6Comments  路  Source: drupal-composer/drupal-project

I think we should use public instead of web for default root.

It looks like a pretty straightforward change. In the composer json,

        "installer-paths": {
            "public/core": ["type:drupal-core"],
            "public/libraries/{$name}": ["type:drupal-library"],
            "public/modules/contrib/{$name}": ["type:drupal-module"],
            "public/profiles/contrib/{$name}": ["type:drupal-profile"],
            "public/themes/contrib/{$name}": ["type:drupal-theme"],
            "drush/Commands/{$name}": ["type:drupal-drush"]
        },

and minor changes also in the git ignore

# Ignore directories generated by Composer
/drush/contrib/
/vendor/
/public/core/
/public/modules/contrib/
/public/themes/contrib/
/public/profiles/contrib/
/public/libraries/

# Ignore sensitive information
/public/sites/*/settings.php
/public/sites/*/settings.local.php

# Ignore Drupal's file directory
/public/sites/*/files/

# Ignore SimpleTest multi-site environment.
/public/sites/simpletest

# Ignore files generated by PhpStorm
/.idea/

# Ignore .env files as they are personal
/.env

Thoughts?

Most helpful comment

As I understand it, drupal-composer/drupal-project chose to use web because that was the Symfony 2.x/3.x standard. Since Drupal 8 still uses (and will forever use) Symfony 3.x, I think it makes sense to keep it as web while using Symfony 3.x.

However, Symfony 4.x has switched to public (in https://github.com/symfony/flex/pull/122). I think it would make sense to make the same change to public when Drupal 9 comes out and upgrades to Symfony 4 or 5 (per https://www.drupal.org/project/drupal/issues/3009219), but this project might be in core by then. 馃槂

All 6 comments

Why?

I think it would break a lot of off-site documentation or issues (drupal.org, Drupal Answers etc.), and that there鈥檚 absolutely no benefit.

I put this here just to get feedback but I sincerely think we should do this because this is what symfony and laravel do.
If not, at least we can make it configurable but I think the real solution is to use public because conventions are nice.

As I understand it, drupal-composer/drupal-project chose to use web because that was the Symfony 2.x/3.x standard. Since Drupal 8 still uses (and will forever use) Symfony 3.x, I think it makes sense to keep it as web while using Symfony 3.x.

However, Symfony 4.x has switched to public (in https://github.com/symfony/flex/pull/122). I think it would make sense to make the same change to public when Drupal 9 comes out and upgrades to Symfony 4 or 5 (per https://www.drupal.org/project/drupal/issues/3009219), but this project might be in core by then. 馃槂

Why is this being forced? A lot of hosts (Acquia, Pantheon, etc) don't reference it that way. It would be better to make it simple to change it to the directory you want it to be.

Fully agree with @fafnirical.

This issue needs to be postponed, and make those changes when Drupal 9 is coming out to release.

It's a good thing to be in sync with our main core dependency. For new users coming from Laravel, Symfony and other frameworks this will be more "friendly" and major release is a good time to make those changes.

Also, want to put my two cents. For the private file system, I'm using "../private" folder. Will be nice, if public folder actually will be "public", not "web", which not makes a lot of sense. There is a lot of control panels for servers, they are also using "public_html" and "private_html" naming for projects.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

criley picture criley  路  6Comments

chanster picture chanster  路  5Comments

ksicon picture ksicon  路  9Comments

vouza picture vouza  路  6Comments

michaellenahan picture michaellenahan  路  3Comments