PHPackages                             davidbarratt/custom-installer - 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. davidbarratt/custom-installer

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

davidbarratt/custom-installer
=============================

Install custom types into custom locations.

1.1.0(5y ago)282.5M↑27%9[2 issues](https://github.com/davidbarratt/custom-installer/issues)3Apache-2.0PHPCI failing

Since Sep 1Pushed 5y ago5 watchersCompare

[ Source](https://github.com/davidbarratt/custom-installer)[ Packagist](https://packagist.org/packages/davidbarratt/custom-installer)[ Docs](https://github.com/davidbarratt/custom-installer)[ RSS](/packages/davidbarratt-custom-installer/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (3)

Composer Custom Type Installer
==============================

[](#composer-custom-type-installer)

[![Build Status](https://camo.githubusercontent.com/938b6902bc150e706a3cd89dd3a3deff1b22f96d585c54f54f822c65302a83ca/68747470733a2f2f7472617669732d63692e6f72672f6461766964626172726174742f637573746f6d2d696e7374616c6c65722e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/davidbarratt/custom-installer)

Adds a root-level custom [type](https://getcomposer.org/doc/04-schema.md#type) installer path to composer.json. Any custom type can be used to define a path the [type](https://getcomposer.org/doc/04-schema.md#type) should be installed in.

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

[](#installation)

Simply require this library in your composer.json file. Typically this will be added as a dependency of the custom [type](https://getcomposer.org/doc/04-schema.md#type) to ensure that the library is loaded before the library that needs it. However, this can be added to the root composer.json, as long as it goes before any library that needs it.

```
{
    "require": {
        "davidbarratt/custom-installer": "1.0.*@dev"
    }
}
```

Usage
-----

[](#usage)

The added parameter(s) are only allowed on the root to avoid conflicts between multiple libraries. This also prevents a project owner from having a directory accidentally wiped out by a library. Note: Each package will go in it’s respective folder in the order in which they are installed.

The configuration has to be added in `custom-installer` of `composer.json`'s `extra` section. It is similar to [Composer installer's installation paths](https://github.com/composer/installers#custom-install-paths).

### Pattern syntax

[](#pattern-syntax)

The key of the the configuration array is the path pattern. You can use some replacement tokens:

- `{$name}`: The name of the package (e.g. `yaml` of `symfony/yaml`)
- `{$vendor}`: The vendor of the package (e.g. `symfony` of `symfony/yaml`)
- `{$type}`: for the composer package type (e.g. `library`, `drupal-module`)

### Package filters

[](#package-filters)

The value of the configuration array has to be an array. It holds the package filter for the given pattern. The pattern will be applied if any filter matches.

#### Package type filter

[](#package-type-filter)

With `type:[package-type]` you can define a pattern per package type. You can use any custom package type and [are not limited to a predefined set](https://github.com/composer/installers#should-we-allow-dynamic-package-types-or-paths-no).

Composer specific package types `metapackage` or `composer-plugin` will never be handled by *Custom Installer*.

Example: `type:custom-library` for package type `custom-library`

#### Package name filter

[](#package-name-filter)

You can specify a pattern per full package name (`[vendor]/[name]`).

*Custom Installer* will only handle a specific package if a configuration exists that also handles the package type in general.

### Examples

[](#examples)

```
{
    "extra": {
        "custom-installer": {
            "web/": ["type:drupal-core"],
            "web/sites/{$name}/": ["type:drupal-site"],
            "custom/{$type}/{$vendor}/{$name}/": ["type:random-type"],
            "vendor/{$vendor}/{$name}/": ["type:library"],
            "web/sites/all/libraries/{$name}/": [
                "type:component",
                "ckeditor/ckeditor",
                "flesler/jquery.scrollto"
            ],
            "custom-folder-for-single-package": ["myvendorname/single-package"],
        }
    }
}
```

In the example we want to make sure *CKEditor* and *Jquery ScrollTo* will be placed in `web/sites/all/libraries`. Both packages are of of package type `library`. In order to change the path of those packages, we must declare a fallback for the package type `library`. It shall stay in the default vendor location (as `library` is the default composer package type). If you do not do that the custom installer cannot handle the single packages (`ckeditor` and `flesler/jquery.scrollto` ) due to [the way composer installer plugins work](https://github.com/composer/composer/pull/4059).

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~764 days

Total

4

Last Release

2075d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e6fc8ba46d236d5a86fb070602b551af9b5d138de701e3254082eff4dbe6f201?d=identicon)[davidbarratt](/maintainers/davidbarratt)

---

Top Contributors

[![derhasi](https://avatars.githubusercontent.com/u/118502?v=4)](https://github.com/derhasi "derhasi (23 commits)")[![davidbarratt](https://avatars.githubusercontent.com/u/868364?v=4)](https://github.com/davidbarratt "davidbarratt (21 commits)")[![suzymasri](https://avatars.githubusercontent.com/u/12935384?v=4)](https://github.com/suzymasri "suzymasri (2 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/davidbarratt-custom-installer/health.svg)

```
[![Health](https://phpackages.com/badges/davidbarratt-custom-installer/health.svg)](https://phpackages.com/packages/davidbarratt-custom-installer)
```

###  Alternatives

[symfony/runtime

Enables decoupling PHP applications from global state

740103.0M1.2k](/packages/symfony-runtime)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5346.5M600](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2125.4M213](/packages/drupal-core-project-message)[phpro/grumphp-shim

GrumPHP Phar distribution

284.9M348](/packages/phpro-grumphp-shim)[automattic/jetpack-autoloader

Creates a custom autoloader for a plugin or theme.

566.3M167](/packages/automattic-jetpack-autoloader)[altis/core

Core module for Altis

19233.0k4](/packages/altis-core)

PHPackages © 2026

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