mcaskill/composer-exclude-files

Exclude files from autoload_files.php

Installs: 46 326

Dependents: 2

Suggesters: 0

Security: 0

Stars: 18

Watchers: 1

Forks: 3

Open Issues: 0

Type:composer-plugin

v2.0.0 2020-09-25 22:01 UTC

This package is auto-updated.

Last update: 2020-10-07 20:10:15 UTC


README

Build Status Coverage Status License GitHub Tag

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

Installation

The plugin can be installed locally or globally.

$ composer require mcaskill/composer-exclude-files

Usage

You can only ignore files from your main composer.json. File exclusions of dependencies' composer.jsons are ignored.

From your main composer.json, add the exclude-from-files property to the extra section. The list of paths must be relative to this composer manifest.

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

Example:

{
    "require": {
        "illuminate/support": "^5.5"
    },
    "extra": {
        "exclude-from-files": [
            "illuminate/support/helpers.php"
        ]
    }
}

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

This is licensed under MIT.