Introduction
Learn how to use Integrated Composer.
Composer is a widely-used dependency and package manager for PHP. Composer provides an easy way to manage packages used by a WordPress site. Packages can be WordPress plugins, Drupal modules, themes, other PHP libraries and even the core CMS itself.
At the most basic level, Composer requires:
- A list of dependencies
- A place to put the dependencies
Understanding how Composer can be used independent of Drupal or WordPress is a good place to learn more about the general concepts. For a summary of basic usage, see Composer's own documentation.
Integrated Composer is a Pantheon platform feature that extends Composer functionality to WordPress and Drupal's core files, and treats them as a managed dependency. Integrated Composer enables one-click updates from the Dashboard for upstream updates and Composer dependencies on your Composer-managed Pantheon site.
Get Started With Integrated Composer
Drupal with Integrated Composer
Follow the steps to Create a new Composer-managed CMS site to add a new Drupal site with Integrated Composer built in.
To upgrade or migrate an existing site to Drupal with Integrated Composer, visit the Migrate to Drupal guide.
To convert an existing Drupal site to a Composer-managed site with Integrated Composer, visit the Composer Convert doc.
drupal-composer-managed
is the recommended Composer-based Drupal upstream. The following Composer-based Drupal upstreams have been deprecated:
drupal-project
drupal-recommended
You can use the Terminus Conversion Tools Plugin if you want to convert your site from one of the deprecated upstreams to the supported drupal-composer-managed
upstream.
WordPress with Integrated Composer
Follow the steps to Create a new Composer-managed CMS site to add a new WordPress site with Integrated Composer built in.
To upgrade or migrate an existing Composer-managed WordPress site to Pantheon with Integrated Composer, please reach out to our Professional Services team for information on site migration services.
wordpress-composer-managed
is the recommended Composer-based WordPress upstream. The following Composer-based WordPress upstreams have been deprecated:
wordpress-composer
example-wordpress-composer
wordpress-project
Dependencies
Composer encourages a mental model where code not written specifically for a given project is a dependency. Only files unique to the project are tracked as part of the project's main source repository, also referred to as the canonical site repository. Dependencies for WordPress and Drupal include core, plugins, contrib modules, themes, and libraries. A single dependency, such as a theme, is referred to as a package. Review Composer require
and require dev
Sections for more information on how these sections are on used on the Pantheon platform.
Composer looks within The PHP Package Repository for dependencies to install, which does not include Drupal or WordPress packages by default. Additional repositories must be configured for Composer to use packages not found in the default repository. Each framework provides its own respective package repository so dependencies can be managed with Composer:
- WordPress: https://wpackagist.org
- Drupal:
https://packages.drupal.org/8
Managing Core as a Project Dependency
Integrated Composer sites use the nested docroot feature, which allows core to be installed within the web
subdirectory instead of the default root directory of the site's codebase. A nested docroot is the simplest path towards reliable core updates in a Composer workflow. This is done on Pantheon by specifying web_docroot: true
in the Pantheon configuration file.
When using a Pantheon-maintained upstream for an Integrated Composer site(either Drupal or WordPress), the nested docroot setting is already configured in the pantheon.upstream.yml
file.