PHPackages                             skywire/composer-copy-file - 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. skywire/composer-copy-file

ActiveLibrary

skywire/composer-copy-file
==========================

Composer script copying your files after install

0.5.1(4y ago)05.0k1MITPHPPHP &gt;=5.6

Since Sep 25Pushed 4y agoCompare

[ Source](https://github.com/Skywire/CopyFile)[ Packagist](https://packagist.org/packages/skywire/composer-copy-file)[ Docs](https://github.com/SlowProg/composer-copy-file)[ RSS](/packages/skywire-composer-copy-file/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)Dependencies (6)Versions (11)Used By (1)

[![Build Status](https://camo.githubusercontent.com/45991dba805f5f990251c4a100b9c43ddc322048ff4d6ec1586f6379e4c7ced4/68747470733a2f2f7472617669732d63692e6f72672f736c6f7770726f672f436f707946696c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/slowprog/CopyFile)[![Latest Stable Version](https://camo.githubusercontent.com/3159616edb48aae23e65864298446f257031d3693d332f5bc3879ccb09709d6d/68747470733a2f2f706f7365722e707567782e6f72672f736c6f7770726f672f636f6d706f7365722d636f70792d66696c652f76657273696f6e)](https://packagist.org/packages/slowprog/composer-copy-file)[![Total Downloads](https://camo.githubusercontent.com/3655dac6465fb4ce8b68e786afb700707b27b1699a08e039032b7a37ffd7042a/68747470733a2f2f706f7365722e707567782e6f72672f736c6f7770726f672f636f6d706f7365722d636f70792d66696c652f646f776e6c6f616473)](https://packagist.org/packages/slowprog/composer-copy-file)

Composer copy file
==================

[](#composer-copy-file)

Composer script copying your files after install. Supports copying of entire directories, individual files and complex nested directories.

For example copy fonts:

```
{
    "require":{
        "twbs/bootstrap": "~3.3",
        "slowprog/composer-copy-file": "~0.3"
    },
    "scripts": {
        "post-install-cmd": [
            "SlowProg\\CopyFile\\ScriptHandler::copy"
        ],
        "post-update-cmd": [
            "SlowProg\\CopyFile\\ScriptHandler::copy"
        ]
    },
    "extra": {
        "copy-file": {
            "vendor/twbs/bootstrap/fonts/": "web/fonts/"
        }
    }
}

```

In a development you may use `-dev` suffix. For example copy non-minified in development and minified in production:

```
{
    "require":{
        "twbs/bootstrap": "~3.3",
        "slowprog/composer-copy-file": "~0.3"
    },
    "scripts": {
        "post-install-cmd": [
            "SlowProg\\CopyFile\\ScriptHandler::copy"
        ],
        "post-update-cmd": [
            "SlowProg\\CopyFile\\ScriptHandler::copy"
        ]
    },
    "extra": {
        "copy-file": {
            "vendor/twbs/bootstrap/dist/js/bootstrap.min.js": "web/js/bootstrap.js"
        },
        "copy-file-dev": {
            "vendor/twbs/bootstrap/dist/js/bootstrap.js": "web/js/bootstrap.js"
        }
    }
}

```

Use cases
---------

[](#use-cases)

You need to be careful when using a last slash. The file-destination is different from the directory-destination with the slash.

If in destination directory already exists copy of file, then it will be override. To overwrite only older files append `?` in end of destination path.

Source directory hierarchy:

```
dir/
    subdir/
        file1.txt
        file2.txt

```

1. Dir-to-dir:

    ```
    {
        "extra": {
            "copy-file": {
                "dir/subdir/": "web/other/"
            }
        }
    }

    ```

    Result:

    ```
    web/
        other/
            file1.txt
            file2.txt

    ```
2. File-to-dir:

    ```
    {
        "extra": {
            "copy-file": {
                "dir/subdir/file1.txt": "web/other/",
                "dir/subdir/file2.txt": "web/other/file2.txt/"
            }
        }
    }

    ```

    Result:

    ```
    web/
        other/
            file1.txt
            file2.txt/
                file2.txt

    ```
3. File-to-file:

    ```
    {
        "extra": {
            "copy-file": {
                "dir/subdir/file1.txt": "web/other/file1.txt",
                "dir/subdir/file2.txt": "web/other/file_rename.txt"
            }
        }
    }

    ```

    Result:

    ```
    web/
        other/
            file1.txt
            file_rename.txt

    ```
4. Override only older files:

    ```
    {
        "extra": {
            "copy-file": {
                "dir/subdir/": "web/other/?"
            }
        }
    }

    ```

    Preset:

    ```
    web/
        other/
            file1.txt - Recently modified
            file2.txt - Old rotten file

    ```

    Result:

    ```
    web/
        other/
            file1.txt - Not changed
            file2.txt - Replaced

    ```
5. Filter source files by regexp pattern

    ```
    {
        "extra": {
            "copy-file": {
                "dir/subdir#1\.\w{3}$": "web/other/"
            }
        }
    }

    ```

    Result:

    ```
    web/
        other/
            file1.txt

    ```
6. Do not overwrite existing files

    ```
    {
        "extra": {
            "copy-file": {
                "dir/subdir/": "web/other/!"
            }
        }
    }

    ```

    Preset:

    ```
    web/
        other/
            file1.txt - Recently modified
            file2.txt - Existing File

    ```

    Result:

    ```
    web/
        other/
            file1.txt - Not changed
            file2.txt - Not changed

    ```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.3% 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 ~220 days

Recently: every ~235 days

Total

9

Last Release

1756d ago

PHP version history (2 changes)0.1.2PHP &gt;=5.3.3

0.3.0PHP &gt;=5.6

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1172463?v=4)[Skywire](/maintainers/skywire)[@Skywire](https://github.com/Skywire)

---

Top Contributors

[![slowprog](https://avatars.githubusercontent.com/u/1294672?v=4)](https://github.com/slowprog "slowprog (20 commits)")[![lar-dragon](https://avatars.githubusercontent.com/u/7447335?v=4)](https://github.com/lar-dragon "lar-dragon (12 commits)")[![valguss](https://avatars.githubusercontent.com/u/105925?v=4)](https://github.com/valguss "valguss (3 commits)")[![umpirsky](https://avatars.githubusercontent.com/u/208957?v=4)](https://github.com/umpirsky "umpirsky (1 commits)")[![mgrundkoetter](https://avatars.githubusercontent.com/u/1526725?v=4)](https://github.com/mgrundkoetter "mgrundkoetter (1 commits)")[![luklewluk](https://avatars.githubusercontent.com/u/6748300?v=4)](https://github.com/luklewluk "luklewluk (1 commits)")[![Demoli](https://avatars.githubusercontent.com/u/1056237?v=4)](https://github.com/Demoli "Demoli (1 commits)")

---

Tags

copy file

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/skywire-composer-copy-file/health.svg)

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

###  Alternatives

[slowprog/composer-copy-file

Composer script copying your files after install

481.0M30](/packages/slowprog-composer-copy-file)

PHPackages © 2026

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