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

5.0.0(2mo ago)401.0M↓13.3%511MITPHPPHP ^7.2.5 || ^8.0CI passing

Since Jan 7Pushed 2w 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 1w ago

READMEChangelog (10)Dependencies (8)Versions (13)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 requires at least Composer v2.9.

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": "^13.9"
    },
    "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": "^13.9"
    },
    "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

64

—

FairBetter than 99% of packages

Maintenance93

Actively maintained with recent releases

Popularity50

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 87.4% 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 ~308 days

Recently: every ~344 days

Total

11

Last Release

60d 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

v4.0.1 → 5.0.02026-06-18

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 (111 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 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

[symfony/runtime

Enables decoupling PHP applications from global state

740103.0M1.2k](/packages/symfony-runtime)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5346.5M600](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2125.4M213](/packages/drupal-core-project-message)[phpro/grumphp-shim

GrumPHP Phar distribution

284.9M348](/packages/phpro-grumphp-shim)[automattic/jetpack-autoloader

Creates a custom autoloader for a plugin or theme.

566.3M167](/packages/automattic-jetpack-autoloader)[altis/core

Core module for Altis

19233.0k4](/packages/altis-core)

PHPackages © 2026

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