Skip to content
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

Auto-Detect Drupal Single Site Install Path #44

Closed
shama opened this issue Nov 10, 2012 · 6 comments
Closed

Auto-Detect Drupal Single Site Install Path #44

shama opened this issue Nov 10, 2012 · 6 comments

Comments

@shama
Copy link
Contributor

shama commented Nov 10, 2012

Reference #42, #36 and #15. The Drupal types currently require the composer.json to be located in the sites/all folder to allow for multi-sites. It appears to be common to want to locate the composer.json in the root of a drupal app. So would be nice for the DrupalInstaller to detect whether it's in root of the app to prefix sites/all/ to the install path.

@RobLoach has done this in his DrupalInstaller. I think the detection stuff makes sense (and would love a PR or your copy permission Rob) but I would like to get #43 done first.

This would make it so core drupal modules and themes cannot be installed with composer/installers. Which is a good thing but just making it clear.

@RobLoach
Copy link
Contributor

Would be nice to merge some of that into the Drupal Installer. If I get some time in the next few days, I could have a look.

@jpstacey
Copy link

Drush make permits downloading of (and specifying a version of) a Drupal core along with everything else. With that in mind, it would be great if core downloading could be folded into installers somehow as a new type (e.g. drupal-core): if core couldn't be installed in and around the composer.json at the top level (a tall order, I guess), it would be fine to install it into e.g. core/ , and then have modules etc. go into core/sites/all/modules etc. should such a core/ folder exist.

Right now, an installers-based composer file can't build an entire Drupal codebase, ready to go: it can only build the dependencies in sites/all , and then you need to step outside composer and work out/keep track of what version of core you need. It feels like so much of the work has already been done, and what's left is an omission easily solved by composer installers somehow, but I don't want to be too blase about work other people might have to do!

@davidbarratt
Copy link
Contributor

Using the Custom Installer Paths allows you to have your composer.json file in the root of your Drupal project and specify the location you want each type to go in. For instance in my composer.json file I have this:

"extra": {
  "installer-paths": {
    "web/sites/all/modules/{$name}/": ["type:drupal-module"]
  }
}

You could easily customize this to put different dependencies in different site folders. You can then use Composer Vendor Autoload to load the autoload file (of non-drupal dependencies)

You are correct, there is no way to manage Drupal core. There is a Webroot Composer Library Installer, but I don't think you could manage Drupal core and Drupal modules together since one goes inside the other, but it might work.

Ideally, Drupal core needs to be in it's own repository as described in Allow a user-editable composer.json file in Drupal's root directory to manage (custom) dependencies.

Thanks!

@davidbarratt
Copy link
Contributor

I wrote a little library based on #180 that allows you to install any type, anywhere.
https://github.com/davidbarratt/custom-installer

I found out that, you can in fact manage Drupal Core this way. Drupal core just has to be installed before any modules, themes, sites, etc. are installed.

Thanks!

@jpstacey
Copy link

jpstacey commented Sep 1, 2014

@davidbarratt thanks - I'll look into that. I'm looking at make->composer replacement at the moment, and that would definitely help lower the barrier there.

(I'd still argue there's scope for discussing what the default behaviour should be, though: but that depends a lot on the most popular scenario, though, for which I have no data!)

@Seldaek
Copy link
Member

Seldaek commented Dec 8, 2020

Closing here as it is very very old, and I'm assuming another solution was found if there really was something to fix.

@Seldaek Seldaek closed this as completed Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants