PHPackages                             php-kit/composer-expose-packages-plugin - 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. php-kit/composer-expose-packages-plugin

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

php-kit/composer-expose-packages-plugin
=======================================

Makes package development easier by editing them on any project via the same central filesystem location

2.2.0(8y ago)139MITPHP

Since Sep 21Pushed 8y ago2 watchersCompare

[ Source](https://github.com/php-kit/composer-expose-packages-plugin)[ Packagist](https://packagist.org/packages/php-kit/composer-expose-packages-plugin)[ Docs](https://github.com/php-kit/composer-expose-packages-plugin)[ RSS](/packages/php-kit-composer-expose-packages-plugin/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (9)Used By (0)

Composer expose packages plugin
-------------------------------

[](#composer-expose-packages-plugin)

Makes package development easier by editing them on any project via the same central filesystem location.

### Introduction

[](#introduction)

This Composer plugin simplifies the development of packages that are being used on multiple projects.

During a project's package installation (via `composer install` or `composer update`), it creates symlinks on a "junction directory" for each package that is "exposed".

Which packages are selected for exposure is determined by a set of matching patterns that are defined the project's `composer.json` or on a global `composer.json` (which defines rules for all projects).

The same packages on different projects will always be available on the same location on the junction directory; all you have to do is to run the `composer expose` command whenever you switch projects.

Additionaly, it creates a backup of all exposed packages to a "source directory", which can be exposed on the junction directory by running the `composer expose-source` command.

Finally, you can get status information about which packages on a project are being exposed by running the `composer expose-status` command.

#### Use cases

[](#use-cases)

These features are quite useful when you want to:

- edit packages on their own repository (the 'source directory') or directly on any of the projects that use them, but always via the same central filesystem location (the junction directory);
- register a package's repository only once on your VCS GUI client (ex: Git), and reuse that registration for any project you work on that uses that package;
- automatically configure an authenticated `origin` remote with write permissions, for all exposed packages.

#### Additional Features

[](#additional-features)

- On MacOS, if you have SourceTree installed, it updates the registered repository paths to use the junction directories, not the symlink targets (SourceTree must not be running); this needs to be done only once for each repository;
- Supports custom package installation directories, where some packages may use installer plugins that install them to alternative locations (other than the default `vendor` directory);
- Supports customizing the vendor directory location using the `config.vendor-dir` standard Composer setting;
- Supports symlinking on Windows (using "junctions") - `To be done`.

### Requirements

[](#requirements)

- PHP version &gt;= 5.6
- Operating System: Mac OS X, Linux or Windows (Vista, Server 2008 or a newer version)

### Installing

[](#installing)

The **recommended** setup is to **install the plugin globally** and set its configuration also globally. This way you avoid polluting each project's `composer.json` with information relative to this plugin which will be of no use neither to other developers nor to users of those projects.

##### To install globally on your development machine

[](#to-install-globally-on-your-development-machine)

If it doesn't exist yet, create a `composer.json` file on the composer's configuration folder (usually at `~/.composer`).

> Ex: `~/.composer/composer.json`

Add `php-kit/composer-expose-packages-plugin` to the `composer.json`'s `require` setting.

Run `composer global update` anywhere.

> The plugin will be active for **all** projects **on your machine only**. No packages will be exposed until you configure the plugin to expose **specific** packages and then perform a `composer install|update|expose|expose-source` operation.

##### To install locally, per project

[](#to-install-locally-per-project)

Add `php-kit/composer-expose-packages-plugin` to the `composer.json`'s `require-dev` setting of those projects that will use shared packages.

Delete all packages that you whish to expose and then run `composer update` on the project folder.

> On production, this plugin will not be installed and no packages wil be shared if you run `composer install -no-dev`. That is why the plugin name should be added to `required-dev` and not to `require`.

### Configuring

[](#configuring)

> From this point on, when mentioning `composer.json`, I mean the global one or the project's one, depending on the type of installation you have chosen.

> The plugin will load both the global configuration (if one exists) and the project configuration (again, if one exists) and merge them. Project-specific settings will take precedence over global ones.

Add an extra `expose-packages` configuration section to the `composer.json`'s `extra` section.

On that section, you can specify a `match` setting containing an array of `vendor/packages` names or glob patterns.

> If neither a `match` setting exists, nor a name or pattern are specified, no packages will be exposed.

You can also specify a `junctiondDir` setting that defines the directory path of the central access location for exposed packages. It can be a relative or absolute path and you can also use `~` as an alias to the user's home directory. The default is `~/exposed-packages`.

> These configuration settings only apply to the root `composer.json` of your project. Settings specified on packages will have no effect.

> You can use Wikimedia's `composer-merge-plugin` if you need to also merge those settings with the ones from the main project.

Finally, you may specify a `sourceDir` setting that defines the directory path where backup copies of exposed packages are stored.

#### Example

[](#example)

###### global `composer.json` at `~/.composer`

[](#global-composerjson-at-composer)

```
{
  "require": {
    "php-kit/composer-expose-packages-plugin": "^2.0"
  },
  "extra": {
    "expose-packages": {
      "match": [
        "vendor/package",
        "vendor/prefix-*",
        "vendor/package-*-whatever",
        "vendor/wildcards??",
        "vendor/*",
        "*"
      ],
      "junctiondDir": "~/exposed-packages",
      "sourceDir": "~/packages"
    }
  }
}
```

### Debugging

[](#debugging)

You can run Composer in debug mode with the `-v` flag to enable the output of extended information messages, which can be useful for troubleshooting.

Messages output by this plugin will be prefixed with `[shared-packages-plugin]`.

### TO DO

[](#to-do)

- Windows support

### License

[](#license)

This library is open-source software licensed under the [MIT license](http://opensource.org/licenses/MIT).

Copyright © 2015 by [Cláudio Silva](claudio.silva@impactwave.com) and [Impactwave Lda](impactwave@impactwave.com).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~102 days

Recently: every ~60 days

Total

8

Last Release

3173d ago

Major Versions

1.3.0 → 2.0.02017-01-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/750f00fdbb8cb2fd1c11c5c26b512217451bb001ac48a77542efa7123b9e2124?d=identicon)[impactwave](/maintainers/impactwave)

---

Top Contributors

[![claudio-silva](https://avatars.githubusercontent.com/u/1999803?v=4)](https://github.com/claudio-silva "claudio-silva (33 commits)")

---

Tags

plugincomposer

### Embed Badge

![Health badge](/badges/php-kit-composer-expose-packages-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/php-kit-composer-expose-packages-plugin/health.svg)](https://phpackages.com/packages/php-kit-composer-expose-packages-plugin)
```

###  Alternatives

[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k37.3M2.1k](/packages/ergebnis-composer-normalize)[pyrech/composer-changelogs

Display changelogs after each composer update

5904.0M25](/packages/pyrech-composer-changelogs)[sllh/composer-versions-check

Checks if packages are up to date to last major versions after update

2352.4M16](/packages/sllh-composer-versions-check)[veewee/composer-run-parallel

Run composer tasks in parallel

91748.2k13](/packages/veewee-composer-run-parallel)[laminas/laminas-component-installer

Composer plugin for injecting modules and configuration providers into application configuration

294.1M95](/packages/laminas-laminas-component-installer)[netresearch/composer-patches-plugin

Composer patches plugin

80262.1k7](/packages/netresearch-composer-patches-plugin)

PHPackages © 2026

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