PHPackages                             mcaskill/composer-exclude-files - 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. mcaskill/composer-exclude-files

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

mcaskill/composer-exclude-files
===============================

Exclude files from autoload\_files.php

v4.0.1(1y ago)40929.6k↑18.8%511MITPHPPHP ^7.2.5 || ^8.0CI passing

Since Jan 7Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/mcaskill/composer-plugin-exclude-files)[ Packagist](https://packagist.org/packages/mcaskill/composer-exclude-files)[ RSS](/packages/mcaskill-composer-exclude-files/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (12)Used By (11)

Exclude PHP files from Composer
===============================

[](#exclude-php-files-from-composer)

[![Build Status](https://camo.githubusercontent.com/7cf85010df38f270305a70e1b97394632961cf00103ec6e40b558e4ae20fd1c2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6361736b696c6c2f636f6d706f7365722d706c7567696e2d6578636c7564652d66696c65732f746573742e796d6c3f6272616e63683d6d61696e)](https://github.com/mcaskill/composer-plugin-exclude-files/actions)[![Latest Release](https://camo.githubusercontent.com/9114367018330ebedae59a6f00097548616f83749e6033c5fa2773b362d7daa1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f6d6361736b696c6c2f636f6d706f7365722d706c7567696e2d6578636c7564652d66696c65732e737667)](https://github.com/mcaskill/composer-plugin-exclude-files/releases/latest)[![License](https://camo.githubusercontent.com/f4400deaf6c6f6685fa80a99b01d1220cd7fd92f3f25ca26028f558a97e8920d/68747470733a2f2f706f7365722e707567782e6f72672f6d6361736b696c6c2f636f6d706f7365722d6578636c7564652d66696c65732f6c6963656e7365)](https://packagist.org/packages/mcaskill/composer-exclude-files)

A Composer plugin for excluding files required by packages using the `files`autoloading mechanism.

This is useful for ignoring files required for bootstrapping a package or that provide PHP functions, for example.

Resolves [composer/composer#5029](//github.com/composer/composer/issues/5029)

Installation
------------

[](#installation)

The plugin can be installed locally or globally.

```
composer require mcaskill/composer-exclude-files
```

As of Composer 2.2.0, for [additional security](https://getcomposer.org/allow-plugins), you should declare the `allow-plugins` config to allow Composer to run the plugin.

```
composer config allow-plugins.mcaskill/composer-exclude-files true
```

Usage
-----

[](#usage)

> You can only ignore files from the root `composer.json`. File exclusions of dependencies' `composer.json` are ignored.

From the root `composer.json`, add the `exclude-from-files` property to the `extra` section. The list of paths must be relative to this Composer manifest's vendor directory: `//`.

This plugin supports a subset of special characters used by the [`glob()` function](https://php.net/function.glob) to match exclude paths matching a pattern:

- `*` — Matches zero or more characters.
- `?` — Matches exactly one character (any character).

This plugin is invoked before the autoloader is dumped, such as with the commands `install`, `update`, and `dump-autoload`.

###### Example 1: Excluding one file from illuminate/support

[](#example-1-excluding-one-file-from-illuminatesupport)

```
{
    "require": {
        "illuminate/support": "^9.6"
    },
    "extra": {
        "exclude-from-files": [
            "illuminate/support/helpers.php"
        ]
    },
    "config": {
        "allow-plugins": {
            "mcaskill/composer-exclude-files": true
        }
    }
}
```

###### Example 2: Excluding many files from laravel/framework

[](#example-2-excluding-many-files-from-laravelframework)

```
{
    "require": {
        "laravel/framework": "^9.6"
    },
    "extra": {
        "exclude-from-files": [
            "laravel/framework/src/*/helpers.php"
        ]
    },
    "config": {…}
}
```

###### Example 3: Excluding all files

[](#example-3-excluding-all-files)

```
{
    "require": {…},
    "extra": {
        "exclude-from-files": [
            "*"
        ]
    },
    "config": {…}
}
```

The plugin will traverse each package and remove all files in the paths configured above from the prepared autoload map. The vendor files themselves are not removed. The root package is ignored.

The resulting effect is the specified files are never included in `vendor/composer/autoload_files.php`.

License
-------

[](#license)

This is licensed under MIT.

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance61

Regular maintenance activity

Popularity50

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 90.3% 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 ~280 days

Recently: every ~244 days

Total

10

Last Release

531d ago

Major Versions

v1.3.0 → v2.0.02020-09-25

v2.1.0 → v3.0.02022-09-12

v3.0.1 → v4.0.02024-05-19

PHP version history (3 changes)v1.2.0PHP ^5.3.2 || ^7.0

v2.0.0PHP ^5.3.2 || ^7.0 || ^8.0

v3.0.0PHP ^7.2.5 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a4f39523b4b2837562ba0848a0327b8d340118d1ba87cb0f5d59b1d5cb6beba?d=identicon)[mcaskill](/maintainers/mcaskill)

---

Top Contributors

[![mcaskill](https://avatars.githubusercontent.com/u/29353?v=4)](https://github.com/mcaskill "mcaskill (102 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (11 commits)")

---

Tags

composercomposer-plugin

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mcaskill-composer-exclude-files/health.svg)

```
[![Health](https://phpackages.com/badges/mcaskill-composer-exclude-files/health.svg)](https://phpackages.com/packages/mcaskill-composer-exclude-files)
```

###  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)[mglaman/composer-drupal-lenient

1317.4M15](/packages/mglaman-composer-drupal-lenient)[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)

PHPackages © 2026

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