PHPackages                             manubing/composer-drupal-module-handler - 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. manubing/composer-drupal-module-handler

ActiveComposer-plugin

manubing/composer-drupal-module-handler
=======================================

Tries to properly uninstall Drupal modules before removing them.

23.6kPHPCI failing

Since Feb 1Pushed 5y ago1 watchersCompare

[ Source](https://github.com/emmdel/composer-drupal-module-handler)[ Packagist](https://packagist.org/packages/manubing/composer-drupal-module-handler)[ RSS](/packages/manubing-composer-drupal-module-handler/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Automatically uninstall a Drupal module before removing it with Composer
========================================================================

[](#automatically-uninstall-a-drupal-module-before-removing-it-with-composer)

About
=====

[](#about)

This composer-plugin contains a plugin witch tries to properly uninstall a Drupal module before Composer attempts to remove it.

> This plugin is intended to be used with a composer-managed Drupal project, eg: [drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project)

It should eliminate the need of two-steps uninstall/removing process.

How it works
============

[](#how-it-works)

This plugin listens the `prePackageUninstall` Composer event. In case of a package of type `drupal-module` being removed, it tries to:

- Bootstrap Drupal
- Invoke the Module Installer service to uninstall the module

If this plugin can't proceed, Composer will still remove the package.

Installation
============

[](#installation)

```
composer require manubing/composer-drupal-module-handler
```

No configuration required 🎊

Configuration
=============

[](#configuration)

If no configuration is provided, this package will use default values matching [drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project):

- Drupal `app_root` defaults to `{COMPOSER_DIR}/../web`
- Drupal `site_path` defaults to `{app_root}/sites/default`

However, if your project have a different directory structure, use the `composer.json` `extra` section:

```
{
  "extra": {
    "drupal-project": {
      "app-root": "html",
      "site-path": "sites/some-site"
    }
  }
}
```

Note
====

[](#note)

This plugin does not currently support [multisites](https://www.drupal.org/docs/8/multisite) projects.

Credits
=======

[](#credits)

- Supporting organization : [Accelys](https://www.drupal.org/accelys)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/bfca06ef60bf2f6fd7255e3c7c66b4d64ac40414f7aaf0d5f0f41cddfec80428?d=identicon)[manubing](/maintainers/manubing)

---

Top Contributors

[![emmdel](https://avatars.githubusercontent.com/u/249890?v=4)](https://github.com/emmdel "emmdel (3 commits)")

### Embed Badge

![Health badge](/badges/manubing-composer-drupal-module-handler/health.svg)

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

PHPackages © 2026

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