PHPackages                             mglaman/composer-drupal-lenient - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mglaman/composer-drupal-lenient

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

mglaman/composer-drupal-lenient
===============================

2.0.0(1mo ago)1317.4M↑13.2%7[1 issues](https://github.com/mglaman/composer-drupal-lenient/issues)[1 PRs](https://github.com/mglaman/composer-drupal-lenient/pulls)14GPL-2.0-or-laterPHPPHP &gt;=8.3CI passing

Since Jun 24Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/mglaman/composer-drupal-lenient)[ Packagist](https://packagist.org/packages/mglaman/composer-drupal-lenient)[ GitHub Sponsors](https://github.com/mglaman)[ RSS](/packages/mglaman-composer-drupal-lenient/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (17)Versions (15)Used By (14)

Drupal Lenient Composer Plugin
==============================

[](#drupal-lenient-composer-plugin)

Lenient with it, Drupal 11 with it.

Why?
----

[](#why)

The Drupal community introduced a lenient Composer facade that modified the `drupal/core` constraint for packages. This was done to remove a barrier with getting extensions installed via Composer to work on making modules Drupal 9 ready.

We hit the same problem, again. At DrupalCon Portland we sat down and decided a Composer plugin is the best approach.

See [Add a composer plugin that supports 'composer require-lenient' to support major version transitions](https://www.drupal.org/project/drupal/issues/3267143).

Drupal documentation page: [Using Drupal's Lenient Composer Endpoint](https://www.drupal.org/docs/develop/using-composer/using-drupals-lenient-composer-endpoint).

How
---

[](#how)

This subscribes to `PluginEvents::PRE_POOL_CREATE` and filters packages. This is inspired by `symfony/flex`, but it does not filter out packages. It rewrites the `drupal/core` constraint on any package with a type of `drupal-*`, excluding `drupal-core`. The constraint is set to `'^8 || ^9 || ^10 || ^11 || ^12'` for `drupal/core`.

Try it
------

[](#try-it)

Set up a fresh Drupal 11 site with this plugin (remember to press `y` for the new `allow-plugins` prompt.)

```
composer create-project drupal/recommended-project d11
cd d11
composer require mglaman/composer-drupal-lenient
```

The plugin only works against specified packages. To allow a package to have a lenient Drupal core version constraint, you must add it to `extra.drupal-lenient.allowed-list`. The following is an example to add Simplenews via the command line with `composer config`

```
composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/simplenews"]'
```

Now, add a module that does [not have a Drupal 11 compatible](https://dev.acquia.com/drupal11/deprecation_status/projects?next_step=Fix%20deprecation%20errors%20found) release!

```
composer require drupal/simplenews
```

🥳 Now you can use [cweagans/composer-patches](https://github.com/cweagans/composer-patches) to patch the module for Drupal 11 compatibility!

For a quick start, allow installing the module by installing [Backward Compatibility](https://www.drupal.org/project/backward_compatibility):

> Backward Compatibility allows you to install old Drupal modules in current Drupal.

Alternatively, manually add the latest version in the module `*.info.yml` file:

```
core_version_requirement: ^9.3 || ^10 || ^11
```

Allowing all packages
---------------------

[](#allowing-all-packages)

If you want to allow all packages to have a lenient Drupal core version constraint, you can set `extra.drupal-lenient.allow-all` to `true`.

```
composer config --json extra.drupal-lenient.allow-all true
```

Using `allow-all` allows you to install any package without needing to add it to the `allowed-list`.

Support when `composer.lock` removed
------------------------------------

[](#support-when-composerlock-removed)

This plugin must be installed globally if your project's `composer.lock` file is removed.

```
composer global config --no-plugins allow-plugins.mglaman/composer-drupal-lenient true
composer global require mglaman/composer-drupal-lenient
```

**Warning**: this means the plugin will run on all Composer commands. This is not recommended, but it is the only way the plugin can work when `composer.lock` is removed.

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance88

Actively maintained with recent releases

Popularity60

Solid adoption and visibility

Community28

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 81.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~170 days

Recently: every ~208 days

Total

9

Last Release

59d ago

Major Versions

1.0.7 → 2.0.02026-03-20

PHP version history (2 changes)1.0.0PHP &gt;=8.1

2.0.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/98c03d4d2a6aa9b5ecdfc565e8f90f53f0a8f6c2757048a148b34b166d78266c?d=identicon)[mglaman](/maintainers/mglaman)

---

Top Contributors

[![mglaman](https://avatars.githubusercontent.com/u/3698644?v=4)](https://github.com/mglaman "mglaman (30 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (2 commits)")[![gitressa](https://avatars.githubusercontent.com/u/3491208?v=4)](https://github.com/gitressa "gitressa (2 commits)")[![byrond](https://avatars.githubusercontent.com/u/767994?v=4)](https://github.com/byrond "byrond (1 commits)")[![NickDickinsonWilde](https://avatars.githubusercontent.com/u/92694?v=4)](https://github.com/NickDickinsonWilde "NickDickinsonWilde (1 commits)")[![RuZniki](https://avatars.githubusercontent.com/u/1125080?v=4)](https://github.com/RuZniki "RuZniki (1 commits)")

---

Tags

composerdrupal

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mglaman-composer-drupal-lenient/health.svg)

```
[![Health](https://phpackages.com/badges/mglaman-composer-drupal-lenient/health.svg)](https://phpackages.com/packages/mglaman-composer-drupal-lenient)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M16](/packages/vaimo-composer-patches)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M446](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[olvlvl/composer-attribute-collector

A convenient and near zero-cost way to retrieve targets of PHP 8 attributes

184108.8k8](/packages/olvlvl-composer-attribute-collector)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)[altis/local-server

Local Server module for Altis

18208.4k2](/packages/altis-local-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
