Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is inconsistent with names of directories. Why for the
- modules/
- includes/
- themes/
- scripts/
- tests/
directory the plural name used and for the
- lib/
- vendor/
directory the singular name used?
I think the lib/ and vendor/ should be renamed to libs/ and vendors/ respectively.
Comments
Comment #1
catchThere's was lots and lots of discussion of these before the patch went in. Either way this isn't a major bug, downgrading.
Comment #2
sunMarking as duplicate of #1400748: Proposal for unified namespace organization
Comment #3
effulgentsia CreditAttribution: effulgentsia commentedRe-opening this as a spin-off of #1400748-175: Proposal for unified namespace organization, warranting its own issue rather than bogging that one down.
"lib" and "vendor" were chosen as names to follow conventions used by other projects. Looks like one of those projects, ZF2, names their module folder "module" rather than "modules".
OTOH, on my Mac, if I do
ls /
, I get several folders, including the following:And if I look at Drupal's database tables, I see (which in my opinion, warrants its own separate issue to address, just pointing it out):
So, I guess some questions are:
Comment #4
Crell CreditAttribution: Crell commentedOur SQL standards specify singular names for tables. "users" is still plural because "user" is a reserved word in many databases, and it was easier to just leave it as an exception than to try and figure out the insane escaping we'd need to do otherwise.
I don't know if there is a broader convention for such things. If there is, someone should mention it to the PSR group, and see if a standard can be formed. :-)
Comment #5
webchickOh could we please not? Moving all the stuff into a /core directory, which will require endless amounts of documentation updates, at least had a practical benefit. This is pedantic silliness IMO.
Comment #6
hinikato CreditAttribution: hinikato commentedPlease also consider to use singular instead of using plural. So I suggest to use only one form without using of multiple forms without reasons for the following directories:
includes/
lib/
misc/
modules/
scripts/
tests/
themes/
vendor/
Let's try to see how it could look if we would use the singular names:
- include/
- lib/
- misc/
- module/
- script/
- test/
- theme/
- vendor/
Let's try to see how it could look if would use the plural names:
- includes/
- libs/
- misc/
- modules/
- scripts/
- tests/
- themes/
- vendors/
Does it look more consistent than the current layout of directories?
Comment #7
joachim CreditAttribution: joachim commentedI see 'vendor' as being an adjective rather than a noun -- we don't put actual vendors in that folder (it's rather cramped, they wouldn't like it), but vendor packages.
'lib' on the other hand would be nicer as 'libraries' -- mostly because contrib has being using 'sites/all/libraries' for years now, and here's an occasion where core should really follow that lead.
Comment #8
Crell CreditAttribution: Crell commentedWhat the libraries module in contrib calls a "library" and what we're putting in the lib folder have nothing to do with each other. The libraries folder is more analagous to vendor. That's already being discussed elsewhere.
Comment #9
PanchoRe #6:
/vendor/
is an absolute industry standard, we're finally adopting. We certainly don't want to mess with that./lib/
is a bit less standardized, you can also find/src/
or other names in other projects. However, it is one of the standard directory names and we don't want to mess with that either.So all we could possibly do is rename everything to the singular. While that'd be an option, the other one is not.
Reprioritizing as normal: even though I personally don't care much, this is a reasonable approach which we might adopt or not.
Comment #10
klonosWhile singular might make sense for anything under /core, I still believe we should keep /sites /modules /themes /profiles /libraries /files. Reason being that anything outside /core is meant for end users - not devs.
Comment #11
Crell CreditAttribution: Crell as a volunteer commentedThis is probably won't-fix, but at least no one is getting back to it for quite some time. :-)
Comment #12
dawehnerYeah I really don't think this is an actual problem, especially with
/sites
clearly communicates that Drupal has the multisite feature, which/site
would not.
/site
would sound like/app
in many other standard frameworks. I think really this is not an actual real existing problem to deal with.Comment #13
Crell CreditAttribution: Crell as a volunteer commentedLet's do that then.