Using a distribution

A distribution is a contributed installation profile that is not provided by Drupal core. Why would you want to use a distribution? Distributions provide a specialized version of Drupal with specific feature sets. On Drupal.org when you download an installation profile it not only includes the profile and its modules but a version of Drupal core. Hence the name distribution. You can find a list of all Drupal distributions here https://www.drupal.org/project/project_distribution.

How to do it…

We will follow these steps to download a distribution to use as a customized version of Drupal 8:

  1. Download a distribution from Drupal.org. For this recipe let's use the Demo Framework provided by Acquia https://www.drupal.org/project/df.
  2. Select the recommended version for the 8.x branch.
  3. Extract the folder contents to your web server's document root. You'll notice there is Drupal core and, within the profiles folder, the installation profile's folder df.
  4. Install Drupal as you would normally, by visiting your Drupal site in your browser.
  5. Demo Framework declares itself as an exclusive profile. Distributions which declare this are automatically selected and assumed to be the default installation option.

    Note

    The exclusive flag was added with Drupal 7.22 to improve the experience of using a Drupal distribution http://drupal.org/node/1961012.

  6. Follow the installation instructions and you'll have installed the distribution!

How it works…

Installation profiles work by including additional modules that are part of the contributed project realm or custom modules. The profile will then define them as dependencies to be installed with Drupal. When you select an installation profile, you are instructing Drupal to install a set of modules on installation.

There's more…

Distributions provide a specialized version of Drupal with specific feature sets, but there are a few items worth discussing.

Makefiles

The current standard for generating a built distribution is the utilization of Drush and makefiles. Makefiles allow a user to define a specific version of Drupal core and other projects (themes, modules, third party libraries) that will make up a Drupal code base. It is not a dependency management workflow, like Composer, but is a build tool.

If you look at the Demo Framework's folder you will see drupal-org.make and drupal-org-core.make. These are parsed by the Drupal.org packager to compile the code base and package it as a .zip or .tar.gz, like the one you downloaded.

Installing with Drush

As shown in the first recipe, you can install a Drupal site through the Drush tool. You can instruct Drush to use a specific installation profile by providing it as the first argument. The following command would install the Drupal 8 site using the Demo Framework.

$ drush pm-download df
$ drush site-install df –db-url=mysql://user:pass@localhost/database

See also…

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset