PHPackages                             markocupic/composer-file-copier-plugin - 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. markocupic/composer-file-copier-plugin

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

markocupic/composer-file-copier-plugin
======================================

Copy files or mirroring folders from a package dist directory to the filesystem during 'composer-install-cmd' or 'composer-update-cmd'.

0.2.4(5mo ago)415.2k↓15.7%1[1 issues](https://github.com/markocupic/composer-file-copier-plugin/issues)[1 PRs](https://github.com/markocupic/composer-file-copier-plugin/pulls)3MITPHPPHP ^8.1

Since Jul 19Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/markocupic/composer-file-copier-plugin)[ Packagist](https://packagist.org/packages/markocupic/composer-file-copier-plugin)[ Docs](https://github.com/markocupic/composer-file-copier-plugin)[ RSS](/packages/markocupic-composer-file-copier-plugin/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (10)Used By (3)

[![Logo](https://github.com/markocupic/markocupic/raw/main/logo.png)](https://github.com/markocupic/markocupic/blob/main/logo.png)

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](https://getcomposer.org/doc/04-schema.md#extra) key of the `composer.json` file of your freshly programmed composer package.

Installation
------------

[](#installation)

`composer require markocupic/composer-file-copier-plugin`

Build your composer package
---------------------------

[](#build-your-composer-package)

```
/
├── app/
├── public/
└── vendor/
    └── code4nix/
        └── super-package/
            ├── .github/
            ├── src/
            ├── tests/
            ├── data/
            │   ├── foo.txt
            │   ├── style.css
            │   ├── config.yaml
            │   └── test1/
            │       ├── foo1.txt
            │       ├── style1.css
            │       ├── config1.yaml
            │       └── test2/
            │           ├── foo2.txt
            │           ├── style2.css
            │           └── config2.yaml
            └── composer.json    # configuration goes here!

```

Big thanks to  for sharing this fancy tree generator. ❤️

Configuration
-------------

[](#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:

```
{
    "name": "code4nix/super-package",
    "type": "symfony-bundle",
    "require": {
        "php": "^8.1",
        "markocupic/composer-file-copier-plugin": "^0.1"
    },
    "autoload": {
        "psr-4": {
            "code4nix\\SuperPackage\\": "src/"
        }
    },
    "extra": {
        "composer-file-copier-plugin": [
            {
                "source": "data/foo.txt",
                "target": "foo.txt"
            },
            {
                "source": "data/foo.txt",
                "target": "foo.txt",
                "options": {
                    "OVERRIDE": true
                }
            },
            {
                "source": "data/test1",
                "target": "files/test1",
                "options": {
                    "OVERRIDE": true,
                    "DELETE": true
                }
            },
            {
                "source": "data",
                "target": "files/data",
                "options": {
                    "OVERRIDE": true
                },
                "filter": {
                    "NAME": [
                        "*.css",
                        "*.yaml"
                    ],
                    "DEPTH": [
                        "> 1",
                        "< 3"
                    ]
                }
            }
        ]
    }
}

```

Mandatory keysDescription`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

[](#options)

OptionDescriptionAffects`OVERRIDE`Accepted values: boolean `true` or `false`. Overwrite existing newer files in target directory. Default to `false`.files &amp; 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

[](#filters)

FilterDescription`NAME`Accepted values: array `"NAME": ["*.less","*.json"]`. See [Symfony Finder](https://symfony.com/doc/current/components/finder.html#file-name) component.`NOT_NAME`Accepted values: array `"NOT_NAME": ["*.php","*.js"]`. See [Symfony Finder](https://symfony.com/doc/current/components/finder.html#file-name) component.`DEPTH`Accepted values: array `"DEPTH": ["< 1","> 4"]` See [Symfony Finder](https://symfony.com/doc/current/components/finder.html#directory-depth) component.Additional configuration
------------------------

[](#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:

```
{
    "extra": {
        "composer-file-copier-excluded": ["library", "metapackage", "composer-plugin"]
    }
}
```

⚠️ Last but not least!
----------------------

[](#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.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance65

Regular maintenance activity

Popularity32

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~107 days

Recently: every ~207 days

Total

9

Last Release

176d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1525166?v=4)[Marko Cupic](/maintainers/markocupic)[@markocupic](https://github.com/markocupic)

---

Top Contributors

[![markocupic](https://avatars.githubusercontent.com/u/1525166?v=4)](https://github.com/markocupic "markocupic (20 commits)")

---

Tags

composercopyfilespluginpost-install-cmdpost-update-cmd

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/markocupic-composer-file-copier-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/markocupic-composer-file-copier-plugin/health.svg)](https://phpackages.com/packages/markocupic-composer-file-copier-plugin)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

96374.6k23](/packages/friendsoftypo3-content-blocks)[nativephp/desktop

NativePHP for Desktop

34020.6k3](/packages/nativephp-desktop)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)

PHPackages © 2026

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