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
Requires
- php: ^8.0
- composer-plugin-api: ^2.0
Requires (Dev)
- composer/composer: ^2.2
- phpunit/phpunit: ^9.5
- symfony/var-dumper: ^6.0
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.