-1

I never used Composer before the year 2018 in any significant way but as Drupal 8 was developed with a Composer-centralized philosophy, I'm out to start basing all my Drupal projects (which I usually maintain with Drush as well), on a Composer-environment.

Installing Drupal via Composer and not from drupal.org, I can use two packages: drupal/drupal or drupal/core.

  1. What was the point in naming the package drupal/drupal and not just drupal?

  2. What is the difference between drupal/drupal and drupal/core?

1
  1. The drupal/drupal name is an artifact of the Drupal packagist repository configuration; you're retrieving a Composer package from the drupal vendor (i.e. the Drupal community) for the drupal project (i.e. Drupal core).

    • drupal/core is used for a completely Composer-driven Drupal project where your canonical code repository isn't storing Drupal's codebase but pulling it down as you assemble the project where needed (e.g. local dev, CI build, etc.)
    • Per the README in the drupal/core repository on Packagist:

      This is a Git subtree split of Drupal 8's core directory which can be used to build the directory structure for a Drupal site and has the following advantages over pulling in the entire upstream Drupal repository:

      • All the components of the Drupal site including Drupal, contributed modules and themes, as well as external libraries can be pulled in via Composer
      • Drupal and any external libraries can be bootstrapped via Composer (i.e. without installing any modules for the external libraries)
      • One has full control over index.php, .htaccess, robots.txt, etc. as those files will not be overridden by a Drupal core update
    • drupal/drupal is the entire project built from the core Drupal Git repository. It comes with other pre-made web config you'll need to run the site as if you retrieved the tarball from the Drupal core project page. This method is considered deprecated and is kept around for legacy reasons.

  • 2
    Please update the answer and make it even clearer that you should never use composer create-project drupal/drupal to get Drupal. I know the question is about the names, but ... – hansfn Sep 20 '18 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.