PHPackages                             drustack/composer-preserve-paths - 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. drustack/composer-preserve-paths

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

drustack/composer-preserve-paths
================================

Composer plugin for preserving custom paths and supporting nested packages

1.0.9(9y ago)14.3k2GPL-2.0+PHP

Since Dec 27Pushed 9y ago3 watchersCompare

[ Source](https://github.com/drustack/composer-preserve-paths)[ Packagist](https://packagist.org/packages/drustack/composer-preserve-paths)[ RSS](/packages/drustack-composer-preserve-paths/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (3)Versions (17)Used By (2)

Composer Preserve Paths
=======================

[](#composer-preserve-paths)

[![Build Status](https://camo.githubusercontent.com/ebeac43b411c8fbc971dfadb591c3fa61fdde25ad8cec3f337b5dd9dcb42d143/68747470733a2f2f7472617669732d63692e6f72672f647275737461636b2f636f6d706f7365722d70726573657276652d70617468732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/drustack/composer-preserve-paths)[![Coverage Status](https://camo.githubusercontent.com/b5ab0cae565f4719331b3ffe2bcf870351a1bdeb0abe0702c1d816780067c38c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f647275737461636b2f636f6d706f7365722d70726573657276652d70617468732f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/drustack/composer-preserve-paths?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/af67a0d3dbb8a7e5e5a787140fd51e78adcf4d459bde274f89721daac1d025d3/68747470733a2f2f706f7365722e707567782e6f72672f647275737461636b2f636f6d706f7365722d70726573657276652d70617468732f762f737461626c652e737667)](https://packagist.org/packages/drustack/composer-preserve-paths)[![Total Downloads](https://camo.githubusercontent.com/0b95aef76ddaed5a4201d3d174dc6fc6c6d4a249389ea2af71ebb143903d558b/68747470733a2f2f706f7365722e707567782e6f72672f647275737461636b2f636f6d706f7365722d70726573657276652d70617468732f646f776e6c6f6164732e737667)](https://packagist.org/packages/drustack/composer-preserve-paths)[![License](https://camo.githubusercontent.com/5f89daf42216b81e7e944f0c83f1362c9cd401225071f5042c36bced14f6dbb4/68747470733a2f2f706f7365722e707567782e6f72672f647275737461636b2f636f6d706f7365722d70726573657276652d70617468732f6c6963656e73652e737667)](https://packagist.org/packages/drustack/composer-preserve-paths)

Composer plugin for preserving custom paths and supporting nested packages.

This way you can:

- Provide custom files or directories that will not be overwritten on `composer install` or `composer update`
- Place packages within the directory of another package (using a composer installer like [composer/installers](https://packagist.org/packages/composer/installers))

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

[](#installation)

Simply install the plugin with composer:

```
$ composer require drustack/composer-preserve-paths:~1.0

```

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

[](#configuration)

For configuring the paths you need to set `preserve-paths` within the `extra` of your root `composer.json`.

```
{
    "extra": {
        "preserve-paths": [
            "web/sites/all/modules/contrib",
            "web/sites/all/themes/contrib",
            "web/sites/all/libraries",
            "web/sites/all/drush",
            "web/sites/default/settings.php",
            "web/sites/default/files"
        ]
    }
}

```

Example
-------

[](#example)

An example composer.json using [composer/installers](https://packagist.org/packages/composer/installers):

```
{
    "config": {
        "vendor-dir": "vendor"
    },
    "extra": {
        "installer-paths": {
            "web/": [
                "type:drupal-core"
            ],
            "web/profiles/{$name}/": [
                "type:drupal-profile"
            ],
            "web/sites/all/drush/{$name}/": [
                "type:drupal-drush"
            ],
            "web/sites/all/libraries/{$name}/": [
                "type:drupal-library"
            ],
            "web/sites/all/modules/contrib/{$name}/": [
                "type:drupal-module"
            ],
            "web/sites/all/modules/custom/{$name}/": [
                "type:drupal-custom-module"
            ],
            "web/sites/all/themes/contrib/{$name}/": [
                "type:drupal-theme"
            ],
            "web/sites/all/themes/custom/{$name}/": [
                "type:drupal-custom-theme"
            ]
        },
        "preserve-paths": [
            "web/sites/all/modules/contrib",
            "web/sites/all/themes/contrib",
            "web/sites/all/libraries",
            "web/sites/all/drush",
            "web/sites/default/settings.php",
            "web/sites/default/files"
        ]
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/7"
        }
    ],
    "require": {
        "composer/installers": "~1.0",
        "drupal/drupal": "~7.54",
        "drupal/views": "3.x-dev",
        "drustack/composer-preserve-paths": "~1.0"
    }
}

```

License
-------

[](#license)

- Code released under [GPL-2.0+](https://github.com/drustack/composer-preserve-paths/blob/master/LICENSE)
- Docs released under [CC BY 4.0](http://creativecommons.org/licenses/by/4.0/)

Author Information
------------------

[](#author-information)

- Wong Hoi Sing Edison
    -
    -

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 58.8% 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 ~56 days

Recently: every ~0 days

Total

15

Last Release

3419d ago

Major Versions

0.1.3 → 1.0.02017-01-22

0.1.4 → 1.0.32017-02-04

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/780562?v=4)[Wong Hoi Sing Edison](/maintainers/hswong3i)[@hswong3i](https://github.com/hswong3i)

---

Top Contributors

[![derhasi](https://avatars.githubusercontent.com/u/118502?v=4)](https://github.com/derhasi "derhasi (57 commits)")[![hswong3i](https://avatars.githubusercontent.com/u/780562?v=4)](https://github.com/hswong3i "hswong3i (30 commits)")[![deminy](https://avatars.githubusercontent.com/u/865547?v=4)](https://github.com/deminy "deminy (3 commits)")[![bnchdrff](https://avatars.githubusercontent.com/u/99194?v=4)](https://github.com/bnchdrff "bnchdrff (2 commits)")[![markpavlitski](https://avatars.githubusercontent.com/u/3777070?v=4)](https://github.com/markpavlitski "markpavlitski (2 commits)")[![NickDickinsonWilde](https://avatars.githubusercontent.com/u/92694?v=4)](https://github.com/NickDickinsonWilde "NickDickinsonWilde (2 commits)")[![webflo](https://avatars.githubusercontent.com/u/123946?v=4)](https://github.com/webflo "webflo (1 commits)")

---

Tags

installercomposer-plugincustom pathnested package

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/drustack-composer-preserve-paths/health.svg)

```
[![Health](https://phpackages.com/badges/drustack-composer-preserve-paths/health.svg)](https://phpackages.com/packages/drustack-composer-preserve-paths)
```

###  Alternatives

[symfony/runtime

Enables decoupling PHP applications from global state

74794.9M939](/packages/symfony-runtime)[drupal-composer/preserve-paths

Composer plugin for preserving custom paths and supporting nested packages

271.1M5](/packages/drupal-composer-preserve-paths)[mnsami/composer-custom-directory-installer

A composer plugin, to help install packages of different types in custom paths.

1415.3M59](/packages/mnsami-composer-custom-directory-installer)[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

3014.5M22](/packages/vaimo-composer-patches)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5344.1M526](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2124.0M193](/packages/drupal-core-project-message)

PHPackages © 2026

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