PHPackages                             slowprog/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. slowprog/composer-copy-file

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

slowprog/composer-copy-file
===========================

Composer script copying your files after install

0.3.3(6y ago)491.1M↓16.6%1520MITPHPPHP &gt;=5.6CI failing

Since Sep 25Pushed 6y ago3 watchersCompare

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

READMEChangelog (7)Dependencies (6)Versions (9)Used By (20)

[![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

    ```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.1% 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 ~196 days

Recently: every ~234 days

Total

8

Last Release

2194d 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/1294672?v=4)[SlowProg](/maintainers/SlowProg)[@slowprog](https://github.com/slowprog)

---

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)")[![luklewluk](https://avatars.githubusercontent.com/u/6748300?v=4)](https://github.com/luklewluk "luklewluk (1 commits)")[![mgrundkoetter](https://avatars.githubusercontent.com/u/1526725?v=4)](https://github.com/mgrundkoetter "mgrundkoetter (1 commits)")[![umpirsky](https://avatars.githubusercontent.com/u/208957?v=4)](https://github.com/umpirsky "umpirsky (1 commits)")

---

Tags

copy file

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[misd/linkify

Converts URLs and email addresses in text into HTML links

1163.2M12](/packages/misd-linkify)[n98/junit-xml

JUnit XML Document generation library

169.0M10](/packages/n98-junit-xml)

PHPackages © 2026

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