Download the PHP package markocupic/composer-file-copier-plugin without Composer
On this page you can find all versions of the php package markocupic/composer-file-copier-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download markocupic/composer-file-copier-plugin
More information about markocupic/composer-file-copier-plugin
Files in markocupic/composer-file-copier-plugin
Package composer-file-copier-plugin
Short Description Copy files or mirroring folders from a package dist directory to the filesystem during 'composer-install-cmd' or 'composer-update-cmd'.
License MIT
Homepage https://github.com/markocupic/composer-file-copier-plugin
Informations about the package composer-file-copier-plugin
Composer File Copier Plugin
Let's assume you have developed a composer package. Now you want selected files inside your package to be copied to a defined location on your local file system after each post-install-cmd
and post-update-cmd
event. With a bit of configuration this composer plugin can do this job for you.
The configuration is made inside the extra key of the composer.json
file of your freshly programmed composer package.
Installation
composer require markocupic/composer-file-copier-plugin
Build your composer package
Big thanks to https://tree.nathanfriend.io for sharing this fancy tree generator. :heart:
Configuration
The configuration is made inside the extra key of the composer.json file inside your composer package.
Note, that source paths are always relative to the installation directory of your package.
Note, that target paths are always relative to the project root.
Inside the composer.json of your package:
Mandatory keys | Description |
---|---|
source |
Add a path to a file or directory. The path you set is relative to the package root. |
target |
Add a path to a file or directory. If the source path points to a file, then the destination path should point to a file as well. The target path is always relative to the document root. |
Options
Option | Description | Affects |
---|---|---|
OVERRIDE |
Accepted values: boolean true or false . Overwrite existing newer files in target directory. Default to false . |
files & folders |
DELETE |
Accepted values: boolean true or false . Whether to delete files that are not in the source directory should be deleted. Default to false . This option is not available, when using filters. |
folders |
Filters
Filter | Description |
---|---|
NAME |
Accepted values: array "NAME": ["*.less","*.json"] . See Symfony Finder component. |
NOT_NAME |
Accepted values: array "NOT_NAME": ["*.php","*.js"] . See Symfony Finder component. |
DEPTH |
Accepted values: array "DEPTH": ["< 1","> 4"] See Symfony Finder component. |
Additional configuration
By default this package will not process the following package types: library','metapackage','composer-plugin','project'
.
This can be overridden in your composer.json by specifying which package to exclude:
:warning: Last but not least!
Note, that this is a very powerful but also dangerous tool that can OVERRIDE/DELETE files/folders and DESTROY/DAMAGE your installation if wrongly applied.
All versions of composer-file-copier-plugin with dependencies
composer-plugin-api Version ^2.1
symfony/filesystem Version ^5.0 || ^6.0 || ^7.0
symfony/finder Version ^5.0 || ^6.0 || ^7.0