themosis/composer-exclude-files

Composer plugin that allows you to exclude files from autoloader.

1.0.1 2022-03-23 19:56 UTC

This package is auto-updated.

Last update: 2024-04-24 00:29:41 UTC


README

This plugin allows you to exclude files from your project's autoloader.

Installation

The plugin can be installed globally or on a project basis. Run the following command from your terminal:

composer require themosis/composer-exclude-files

Usage

In order to exclude files from being autoloaded upon a Composer operation, simply specify an exclude-from-files key, followed with a list of files to exclude, under the extra property of your composer.json file like so:

"extra": {
    "exclude-from-files": {
        "laravel/framework": [
            "src/Foundation/helpers.php"
        ],
        "symfony/var-dumper": [
            "Resources/functions/dump.php"
        ]
    }
},

First defined the package name you wish to target and then pass it an array of relative paths to files to exclude from that package.

Notes

This Composer plugin automatically exclude files from your project by looking at all its dependencies. Meaning that exclude rules can be defined in both your root package or into one of its dependencies.

Credits

This Composer plugin has been inspired by the mcaskill/composer-plugin-exclude-files package.

The plugin is a working piece of the Themosis framework.