Posted by wretched sinner... on April 3, 2010 at 9:24am
6 followers
Jump to:
| Project: | Drupal core |
| Version: | 8.x-dev |
| Component: | base system |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | DrupalWTF, DX (Developer Experience) |
Issue Summary
Spawned from, and postponed on #22336: Move all core Drupal files under a /core folder to improve usability and upgrades.
One of the best summaries of the issue is #22336-73.
Basically, we want to discuss whether the sites folder is the best way to store site specific settings, modules, themes etc.
If #22336 is accepted, we then want to look at how we structure the remaining folders in the webroot.
Comments
#1
Grr. set the wrong links to previous issue:
Issue: #22336: Move all core Drupal files under a /core folder to improve usability and upgrades
Summary #22336-73: Move all core Drupal files under a /core folder to improve usability and upgrades
#2
I just read through all of the comments to date on #22336: Move all core Drupal files under a /core folder to improve usability and upgrades. I am against moving site files into webroot. To me, that just complicates things. Then the core/ directory will get lost in a sea of other stuff, reducing the benefits of having it in the first place.
All of my issues as a Drupal newbie (at least as they related to file paths) would have been solved if webroot contained two directories: core/ and sites/. That provides a very clear distinction between the core system (i.e. things I shouldn't touch) and the place where my websites go. All in all, this seems very intuitive.
I also don't think we need to hide the fact that Drupal supports multi-sites. So having sites/all/ and sites/default/ directories makes perfect sense. Again, moving sites/all/* into the root of sites/ would just cause confusion by mixing directories like themes/ and modules/ with directories for individual sites. I understand that this keeps the important site files deeper in the hierarchy, but that hierarchy exists for a reason. It makes it easy to find what you need, even if doing so requires a couple extra clicks.
If clarity is really what you're after, then I don't think changing the file structure is the key. Instead, I'd recommend adding a file at sites/README--about_sites.txt. This, more than anything else, would help newcomers to Drupal in getting their sites set up. This readme file could explain exactly what goes where in the sites directory, including for multi-site installations. It would duplicate much of the documentation in sites/default/default.settings.php, but that's a good thing. Newbies don't know to look in sites/default/default.settings.php for instructions. I sure didn't.
#3
Doesn't seem like the best place to discuss this.. Especially with the recent move to /core
#4
Hey, I was looking for this issue!
I think this is a great idea, personally. It would use the behaviour we currently don't like in Drupal 7 and below ("Oh, look! Here's a modules folder! Let me stick my modules in there!") to our learnability advantage. These ideas I'm pretty sure were already quicksketch's, but putting them here cos I couldn't find them documented anywhere else.
Picture the following:
- core/ - SLAP! Core's stuff. Do not touch this. Just trash the whole folder and replace it upon upgrade.- modules/ - *My* modules! (equivalent to today's sites/all/modules)
- profiles/ - *My* profiles! (equivalent to today's /profiles)
- themes/ - *My* themes! (equivalent to today's sites/all/themes)
- .htaccess - Because this has to go here.
- README.txt - Because OMGWTFBBQ.
- example.gitignore - Because this has to go here.
- index.php - Because this has to go here.
- robots.txt - Because this has to go here.
- settings.php - *My* settings.php! (equivalent to sites/default/settings.php)
- web.config - Because this has to go here.
That's the default directory structure. settings.php ships with a setting:
<?php$multisite = FALSE;
?>
If you want to use multisite, then you change that variable to TRUE and add a "sites/" folder to the mix as well, which operates on the standard lookup pattern in 7.x and below. The difference is it doesn't do the 99% case thing *last* after it's already eliminated the other 30 possible options of where the $conf_path could be (Rasmus chided us for this in Szeged in 2008 and we still haven't fixed it).
I think the concern about the core directory getting lost is a bit overblown. We're only talking about 4 directories here in the default case, 5 if you're using multisite, and *possibly* an extra one if we chose to move docs like CHANGELOG.txt into a "docs/" directory for security hardening (separate issue plz).
#5
I think this is definitely worth looking at. If we could guarantee settings.php is always available in always the same place, then that might fix one chicken/egg issue with the class loader too.
It's fixed by #1055856: Optimize settings.php discovery and #1055862: Require sites.php, the latter we don't need if we require settings.php (in fact we can completely remove sites.php and just use the root settings.php to hold the $sites array), the former is dying for a review :(
#6
Sounds good to me, does that mean that out of the box you can't do multi-site setups? It will be pretty similiair to how you make your site multi-site with wordpress
#7
You'd have to edit settings.php to allow multisite, but it'd only be a one-line change.