Download the PHP package koodimonni/composer-dropin-installer without Composer
On this page you can find all versions of the php package koodimonni/composer-dropin-installer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download koodimonni/composer-dropin-installer
More information about koodimonni/composer-dropin-installer
Files in koodimonni/composer-dropin-installer
Package composer-dropin-installer
Short Description Install packages or a few files from packages into custom paths without overwriting existing stuff.
License WTFPL
Informations about the package composer-dropin-installer
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 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 . See how you can update WordPress languages with composer.
How to use it
Follow the baby steps
1.Require "koodimonni/composer-dropin-installer": "*" or "dev-master"
2.Add custom paths into your composer.json -> extra -> dropin-paths.
3.Enjoy nice dependency management by composer and install things where the fuck you want them to be.
End result looks something like this
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:
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 or object-cache.php.
Some Notices
- Script works nicely together with composer/installers
-
I'm ignoring these files automatically:
- Script requires unix filesystem (OS X,Linux)
Testing
Run PHPUnit tests with
Tests are run inside the tests/
directory where two dummy Composer projects are used to test dropin
installation methods.
Todo
- Handle deletions on removal and on update. This could be easily done with json-database in [vendor-dir]
Changelog
- 1.4 Ignore
readme
readme.txt
changelog.txt
&license.txt
files automatically too. Thanks @ocean90! - 1.3 Support for composer 2.0
- 1.2 Added ability to copy files instead of moving them. Thanks @rask for contributing!
- 1.1.0 Replaced
Composer\Script\PackageEvent
withComposer\Installer\PackageEvent
- 1.0.1 Updated tests to new repository https://wp-languages.github.io
- 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
Thanks to @Seldaek for all of this hard work with packagist.org!
All versions of composer-dropin-installer with dependencies
composer-plugin-api Version ^1.0 | ^2.0