folivoro/composer-dropin-installer

Copies a single file from a package into a target directory defined by installer-paths.

Maintainers

Package info

github.com/folivoro/dropin-installer-plugin

Type:composer-plugin

pkg:composer/folivoro/composer-dropin-installer

Statistics

Installs: 20

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

v0.0.3 2026-05-26 07:25 UTC

This package is auto-updated.

Last update: 2026-05-26 07:25:38 UTC


README

Sloth Logo

Total Downloads Latest Stable Version License CI

Folivoro Composer-Dropin-Installer

A Composer plugin that copies files from any installed package into a target directory — either resolved from the root package's installer-paths configuration, or a direct path relative to the project root.

Why

Some packages need to place a file at a specific location in the project — for example, a WordPress MU-plugin bootstrapper or a shared config file. The standard composer/installers approach installs an entire package directory. This plugin does one thing: copies declared files to the right place.

Installation

composer require folivoro/composer-dropin-installer

Usage

In any package that wants to install dropin files, add to composer.json:

Single file (via installer-paths)

{
    "extra": {
        "dropin": {
            "file": "my-plugin.php",
            "target-type": "wordpress-muplugin",
            "target-dir": "my-plugin"
        }
    }
}

Single file (via direct path)

{
    "extra": {
        "dropin": {
            "file": "pint.json",
            "target-path": "."
        }
    }
}

Multiple files

{
    "extra": {
        "dropins": [
            { "file": "pint.json", "target-path": "." },
            { "file": "phpstan.neon", "target-path": "." },
            { "file": "rector.php", "target-path": "." }
        ]
    }
}

The root project must have installer-paths configured when using target-type:

{
    "extra": {
        "installer-paths": {
            "public/extensions/components/{$name}/": [
                "type:wordpress-muplugin"
            ]
        }
    }
}

Given the above, my-plugin.php will be copied to: