PHPackages                             lastcall/composer-upstream-files - 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. lastcall/composer-upstream-files

ActiveComposer-plugin

lastcall/composer-upstream-files
================================

Composer command to update application files from various upstream sources.

1.1.1(8y ago)21.3k1MITPHP

Since Dec 2Pushed 1y agoCompare

[ Source](https://github.com/LastCallMedia/Composer-Upstream-Files)[ Packagist](https://packagist.org/packages/lastcall/composer-upstream-files)[ RSS](/packages/lastcall-composer-upstream-files/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (5)Used By (0)

Composer Upstream Files Plugin
==============================

[](#composer-upstream-files-plugin)

Composer Upstream Files Plugin is brought to you by your friends at [Last Call Media](https://www.lastcallmedia.com), this [Composer](https://getcomposer.org/) plugin allows you to update files belonging to your application from various upstream sources. There are a couple of different use cases for this:

- You have files that are required for specific versions of your application dependencies, but which need to live as part of your application. For example, Drupal's `index.php` file is required, but must live outside of the `core` directory when you use a Composer based installation.
- You have files you want to allow modifications to (so they're not appropriate for inclusion in a library), but that you want to keep in sync between different projects. For example, a default `.eslintrc` or `phpcs.xml.dist`.

In all cases, the files that would be managed by this plugin should be committed to the application's repository. *This plugin does not automatically update these files* - it only provides a Composer command you can use to update them -- you should do this periodically, then review and commit the resulting changes.

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

[](#installation)

Install this plugin in your application with Composer:

```
composer require --dev lastcall/composer-upstream-files
```

Usage
-----

[](#usage)

Upstream files are defined in the `extra` section of your `composer.json`. Example:

```
{
  "name": "my-awesome-site",
  "require": {
    "my/package": "^1.0.0"
  },
  "extra": {
    "upstream-files": {
      "files": {
        "https://raw.githubusercontent.com/LastCallMedia/Drupal-Scaffold/circle20/.editorconfig": ".editorconfig",
        "https://raw.githubusercontent.com/LastCallMedia/Drupal-Scaffold/circle20/web/.htaccess": "web/.htaccess"
      }
    }
  }
}
```

In this example, we've defined two files with upstream sources. The key of the `files` array is the source, and the value is the destination. When we run `composer upstream-files:update`, both files will be refreshed from their respective URLs. We would then review and commit the changes.

### Tokens

[](#tokens)

This plugin supports using tokens to reduce the amount of stuff you have to type and update. Tokens are enclosed in double brackets. Example:

```
{
  "extra": {
    "upstream-files": {
      "tokens": {
        "scaffold": "https://raw.githubusercontent.com/LastCallMedia/Drupal-Scaffold",
        "drupal": "https://raw.githubusercontent.com/drupal/drupal/{{drupal/core.version}}"
      },
      "files": {
        "{{drupal}}/index.php": "web/index.php",
        "{{scaffold}}/.editorconfig": ".editorconfig"
      }
    }
  }
}
```

You can define any tokens you want to use under the `tokens` key, and use them as replacements for your `files`. Additionally, you can reference the current version of any installed package by using `{{PACKAGENAME.version}}` (as we did with drupal/core above). Tokens are replaced recursively, so if your token contains a token, that's fine.

### Manifests

[](#manifests)

You can also reference "manifests", or JSON files that contain an upstream-files specification. These manifests can be local or remote. See this example:

```
// composer.json
{
  "extra": {
    "upstream-files": {
      "tokens": {
        "scaffoldBranch": "master"
      },
      "manifests": [
        "drupal.json",
        "http://github.com/LastCallMedia/Drupal-Scaffold/upstream-files.json"
      ]
    }
  }
}
```

```
// drupal.json
{
  "tokens": {
    "drupal": "https://raw.githubusercontent.com/drupal/drupal/{{drupal/core.version}}"
  },
  "files": {
    "{{drupal}}/index.php": "web/index.php",
  }
}
```

```
// http://github.com/LastCallMedia/Drupal-Scaffold/upstream-files.json
{
  "tokens": {
    "scaffold": "https://raw.githubusercontent.com/LastCallMedia/Drupal-Scaffold/{{scaffoldBranch}}"
  },
  "files": {
    "{{scaffold}}/.editorconfig": ".editorconfig"
  }
}
```

Manifests can also specify other manifests, which is handy when you need to specify a lot of files.

### Exclusions

[](#exclusions)

It is also possible to exclude files based on their source or destination. This is most useful when you use manifests from upstream projects, and don't want to pull in certain files from upstream:

```
{
  "extra": {
    "upstream-files": {
      "manifests": [
        "drupal.json",
      ],
      "sourceExcludes": [
        "@LastCallMedia/Drupal-Scaffold@"
      ],
      "destinationExcludes": [
        "/\\.gitattributes/"
      ]
    }
  }
}
```

The `sourceExcludes` and `destinationExcludes` properties are both arrays of regular expressions indicating the files you wish to exclude. `sourceExcludes` will be matched against the fully resolved source URL, and `destinationExcludes` will be matched against the fully resolved destination path.

###  Health Score

34

—

LowBetter than 78% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~4 days

Total

4

Last Release

3022d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/08764a9d2125547417a4f3efeee159b4fc1ff4a5094326228e413ef38566da23?d=identicon)[lschumann](/maintainers/lschumann)

![](https://www.gravatar.com/avatar/7a4a154961f7167b96103447056ce7319becb50c4eb836e0cecfd26b08cfd0ba?d=identicon)[chrislcm](/maintainers/chrislcm)

---

Top Contributors

[![rbayliss](https://avatars.githubusercontent.com/u/654407?v=4)](https://github.com/rbayliss "rbayliss (9 commits)")[![sagar-lcm](https://avatars.githubusercontent.com/u/106957476?v=4)](https://github.com/sagar-lcm "sagar-lcm (3 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/lastcall-composer-upstream-files/health.svg)

```
[![Health](https://phpackages.com/badges/lastcall-composer-upstream-files/health.svg)](https://phpackages.com/packages/lastcall-composer-upstream-files)
```

###  Alternatives

[oro/platform

Business Application Platform (BAP)

648132.0k74](/packages/oro-platform)[bacula-web/bacula-web

The open source web based reporting and monitoring tool for Bacula

1537.5k](/packages/bacula-web-bacula-web)

PHPackages © 2026

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