themosis/composer-exclude-files

Composer plugin that allows you to exclude files from autoloader.

Installs: 9 391

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Open Issues: 0

Type:composer-plugin

1.0.1 2022-03-23 19:56 UTC

This package is auto-updated.

Last update: 2024-10-24 01:34:34 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.