zorca/composer-exclude-files

Exclude files from autoload_files.php

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 5

Type:composer-plugin

v1.0.1 2018-12-18 18:10 UTC

This package is auto-updated.

Last update: 2024-04-19 08:40:35 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 either the 'autoload' section or the 'extra' section. The list of paths must be absolute from the vendor directory.

This plugin is invoked before the autoloader is dumped, either during install/update, or via the dump-autoload command.

Example:

{
    "require": {
        "illuminate/support": "^5.5"
    },
    "autoload": {
        "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.