PHPackages                             koodimonni/composer-dropin-installer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. koodimonni/composer-dropin-installer

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

koodimonni/composer-dropin-installer
====================================

Install packages or a few files from packages into custom paths without overwriting existing stuff.

1.4(4y ago)482.6M—3.4%12[6 issues](https://github.com/Koodimonni/Composer-Dropin-Installer/issues)[2 PRs](https://github.com/Koodimonni/Composer-Dropin-Installer/pulls)20WTFPLPHPPHP &gt;=5.3.2CI failing

Since Dec 21Pushed 3y ago5 watchersCompare

[ Source](https://github.com/Koodimonni/Composer-Dropin-Installer)[ Packagist](https://packagist.org/packages/koodimonni/composer-dropin-installer)[ RSS](/packages/koodimonni-composer-dropin-installer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (15)Used By (20)

Composer Dropin installer
=========================

[](#composer-dropin-installer)

[![Build Status](https://camo.githubusercontent.com/b42a2f076d37bead641645b467f8d62ccea15eec76febaae41544b8729279740/68747470733a2f2f7472617669732d63692e6f72672f4b6f6f64696d6f6e6e692f436f6d706f7365722d44726f70696e2d496e7374616c6c65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Koodimonni/Composer-Dropin-Installer)[![Latest Stable Version](https://camo.githubusercontent.com/07d3077107abc547f5181df195763b22b864a19e458aa4af76f597e3b4fd4571/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6f64696d6f6e6e692f636f6d706f7365722d64726f70696e2d696e7374616c6c65722f762f737461626c65)](https://packagist.org/packages/koodimonni/composer-dropin-installer)[![Total Downloads](https://camo.githubusercontent.com/9971f853364589d82b3d2ea4db9b2826f8cf5311a4f66ff3dd1c9182883c6d5e/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6f64696d6f6e6e692f636f6d706f7365722d64726f70696e2d696e7374616c6c65722f646f776e6c6f616473)](https://packagist.org/packages/koodimonni/composer-dropin-installer)[![Latest Unstable Version](https://camo.githubusercontent.com/422b9feaa56d1cccfad16365216170d5352fa042561961a55c6f54d4747a4d31/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6f64696d6f6e6e692f636f6d706f7365722d64726f70696e2d696e7374616c6c65722f762f756e737461626c65)](https://packagist.org/packages/koodimonni/composer-dropin-installer)[![License](https://camo.githubusercontent.com/c5079ac6499b57a3edf5f95f159d3909c06c19787ddd529fd20ff0806b802422/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6f64696d6f6e6e692f636f6d706f7365722d64726f70696e2d696e7374616c6c65722f6c6963656e7365)](https://packagist.org/packages/koodimonni/composer-dropin-installer)

This composer plugin helps you to move or copy your composer packaged files where you want them to be.

Composer only allows you to install full directories into their own directories. There's really useful [composer/installers](https://github.com/composer/installers) for custom installation paths but it overwrites everything in folder and doesn't allow coexist of two or more projects. We just let composer install things and take it from there.

I created this originally for installing multiple languages for WordPress with composer. I needed to have multiple packages living in same directory `htdocs/wp-content/languages`. See how you can [update WordPress languages with composer](https://wp-languages.github.io).

How to use it
-------------

[](#how-to-use-it)

### Follow the baby steps

[](#follow-the-baby-steps)

1.Require "koodimonni/composer-dropin-installer": "\*" or "dev-master"

```
"require": {
    "koodimonni/composer-dropin-installer": "dev-master"
  }
```

2.Add custom paths into your composer.json -&gt; extra -&gt; dropin-paths.

```
"extra": {
    "dropin-paths": {
      "htdocs/wp-content/languages/": ["type:wordpress-language"]
    }
  }
```

3.Enjoy nice dependency management by composer and install things where the fuck you want them to be.

### End result looks something like this

[](#end-result-looks-something-like-this)

```
{
  "name": "koodimonni/wordpress",
  "type": "project",
  "description": "WordPress with composer languages using Koodimonni dropin installer",
  "homepage": "http://github.com/koodimonni/composer-dropin-installer",
  "authors": [
    {
      "name": "Onni Hakala",
      "email": "onni@koodimonni.fi",
      "homepage": "https://github.com/onnimonni"
    }
  ],
  "keywords": [
    "wordpress", "composer", "wp", "languages"
  ],
  "config": {
    "preferred-install": "dist"
  },
  "repositories": [
    {
      "type": "composer",
      "url": "https://wpackagist.org"
    },
    {
      "type": "composer",
      "url": "https://wp-languages.github.io"
    }
  ],
  "require": {
    "php": ">=5.3.2",

    "koodimonni/composer-dropin-installer": "*",

    "johnpbloch/wordpress": "*",
    "composer/installers": "~1.0",
    "vlucas/phpdotenv": "~1.0.6",

    "koodimonni-language/fi": "*",
    "koodimonni-language/et": "*",
    "koodimonni-language/ru_ru": "*",

    "wpackagist-plugin/akismet": "*",
    "wpackagist-plugin/wp-redis": "*",
    "wpackagist-plugin/woocommerce": "*",
    "wpackagist-plugin/wordpress-mu-domain-mapping": "*"
  },
  "extra": {
    "installer-paths": {
      "htdocs/wp-content/plugins/{$name}/": ["type:wordpress-plugin"],
      "htdocs/wp-content/themes/{$name}": ["type:wordpress-theme"]
    },
    "dropin-paths": {
      "htdocs/wp-content/mu-plugins/": ["type:wordpress-muplugin"],
      "htdocs/wp-content/languages/": ["type:wordpress-language"],
      "htdocs/wp-content/languages/plugins/": ["vendor:wordpress-plugin-language"],
      "htdocs/wp-content/languages/themes/": ["vendor:wordpress-theme-language"],
      "htdocs/wp-content/": [
        "package:wpackagist-plugin/wp-redis:object-cache.php",
        "package:wpackagist-plugin/wordpress-mu-domain-mapping:sunrise.php",
        "type:wordpress-dropin"]
    },
    "wordpress-install-dir": "htdocs/wordpress"
  }
}
```

Moving vs. copying files
------------------------

[](#moving-vs-copying-files)

By default this dropin installer moves files from the source to the destination, which means the files disappear from the source.

If you would prefer copying instead (which keeps the files at the source after installation) insert the following configuration to your `composer.json` `config`declarations:

```
"config": {
    "dropin-installer": "copy"
}
```

But how about the impossible looking syntax?
--------------------------------------------

[](#but-how-about-the-impossible-looking-syntax)

Dropin syntax consists from four parts: `"{path}": "{directive}:{target}:{files}"`

**Path** is relative path to destination folder.

**Directive** is one of:

- package - e.g. `package:koodimonni-language/fi`
- vendor - e.g. `vendor:koodimonni-language`
- type - e.g. `type:wordpress-language`

**Files** is optional and by default it will move all files.

In some cases it would be nice to move just one file from the package. I found out that *WordPress dropins* needed just that. Good example is this one: [Domain Mapping](https://wordpress.org/plugins/wordpress-mu-domain-mapping/) or object-cache.php.

Some Notices
------------

[](#some-notices)

- Script works nicely together with composer/installers
- I'm ignoring these files automatically:

```
.DS_store
.git
.gitignore
composer.json
composer.lock
readme
readme.md
readme.txt
changelog.txt
license
license.md
license.txt
phpunit.xml

```

- Script requires unix filesystem (OS X,Linux)

Testing
-------

[](#testing)

Run PHPUnit tests with

```
composer test

```

Tests are run inside the `tests/` directory where two dummy Composer projects are used to test dropin installation methods.

Todo
----

[](#todo)

- Handle deletions on removal and on update. This could be easily done with json-database in \[vendor-dir\]

Changelog
---------

[](#changelog)

- 1.4 Ignore `readme` `readme.txt` `changelog.txt` &amp; `license.txt` files automatically too. Thanks [@ocean90](https://github.com/ocean90)!
- 1.3 Support for composer 2.0
- 1.2 Added ability to copy files instead of moving them. Thanks [@rask](https://github.com/rask) for contributing!
- 1.1.0 Replaced `Composer\Script\PackageEvent` with `Composer\Installer\PackageEvent`
- 1.0.1 Updated tests to new repository
- 1.0 Stable release, updated to newer composer-plugin-api
- 0.2.4 Fixes crashing when 'dropin-paths' is not defined in extra section.
- 0.2.3 Bug fixes and added small notice to user when dropins are runned
- 0.2.2 Bug fixes
- 0.2.1 Bug fixes
- 0.2 Change from custom composer script to composer plugin
- 0.1 Initial release

Finally
-------

[](#finally)

Thanks to [@Seldaek](https://github.com/Seldaek) for all of this hard work with packagist.org!

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity54

Moderate usage in the ecosystem

Community32

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 81.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~216 days

Recently: every ~480 days

Total

13

Last Release

1566d ago

Major Versions

0.2.4 → 1.02015-06-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5691777?v=4)[Onni Hakala](/maintainers/onnimonni)[@onnimonni](https://github.com/onnimonni)

---

Top Contributors

[![onnimonni](https://avatars.githubusercontent.com/u/5691777?v=4)](https://github.com/onnimonni "onnimonni (62 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (6 commits)")[![ocean90](https://avatars.githubusercontent.com/u/617637?v=4)](https://github.com/ocean90 "ocean90 (3 commits)")[![rask](https://avatars.githubusercontent.com/u/98275?v=4)](https://github.com/rask "rask (2 commits)")[![jrmlstf](https://avatars.githubusercontent.com/u/846378?v=4)](https://github.com/jrmlstf "jrmlstf (1 commits)")[![Bogstag](https://avatars.githubusercontent.com/u/8104765?v=4)](https://github.com/Bogstag "Bogstag (1 commits)")[![swalkinshaw](https://avatars.githubusercontent.com/u/295605?v=4)](https://github.com/swalkinshaw "swalkinshaw (1 commits)")

---

Tags

composercomposer-pluginphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/koodimonni-composer-dropin-installer/health.svg)

```
[![Health](https://phpackages.com/badges/koodimonni-composer-dropin-installer/health.svg)](https://phpackages.com/packages/koodimonni-composer-dropin-installer)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M16](/packages/vaimo-composer-patches)[mglaman/composer-drupal-lenient

1317.4M15](/packages/mglaman-composer-drupal-lenient)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M446](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[olvlvl/composer-attribute-collector

A convenient and near zero-cost way to retrieve targets of PHP 8 attributes

184108.8k8](/packages/olvlvl-composer-attribute-collector)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
