PHPackages                             and/isolate-composer - 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. and/isolate-composer

ActiveComposer-plugin

and/isolate-composer
====================

Isolates composer dependencies by prefixing namespace for all vendor code within a project

1.1(3y ago)91.7k8[1 PRs](https://github.com/logical-and/composer-isolation/pulls)MITPHPCI failing

Since Feb 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/logical-and/composer-isolation)[ Packagist](https://packagist.org/packages/and/isolate-composer)[ RSS](/packages/and-isolate-composer/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (4)Versions (5)Used By (0)

Composer Dependency Isolation
=============================

[](#composer-dependency-isolation)

**What this plugin does**

This plugin prefixes all vendor namespaces with a chosen value. This includes all declared namespaces, use statements, fully qualified references, and most string values that reference the namespace.

All vendor code and composer autoload mappings are updated to reference the prefixed namespace.

**What this plugin does not do**

It will not touch any code in your project. It only affects code in the vendor directory, and it only affects code referencing the affected namespaces. You must update all references in your code yourself if you apply this to an existing project.

**Why would I want to use this?**

This plugin allows you to run two projects that utilize composer dependencies in the same runtime, without worrying about conflicting dependencies. The most common example is in a WordPress environment, where all plugins execute in the same runtime, and may rely on the same composer dependencies. Each project utilizing the plugin can't conflict with any other project unless the vendor code is not namespaced (in which case there aren't many options...).

Usage
-----

[](#usage)

Using the plugin is straightforward. Install the plugin by requiring it in your project: `composer require and/isolate-composer`.

Configure the plugin by adding the following to your `composer.json`:

```
"config" : {
    "isolate": {
      "prefix": "Your\\Prefix\\Here\\",
      "blacklist": [],
      "autorun": false,
      "require-dev": false,
      "replacements" : {}
    }
}

```

The only required value is the `prefix`.

After you have configured the plugin, run the isolation:

```
composer isolate
composer dump

```

Your vendor code is now prefixed!

Be sure to `dump` after you `isolate`, or your autoload mappings will be incorrect!

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

[](#configuration)

**prefix**

This is the value that will be prepended to all vendor namespaces. It should be a valid namespace, and should be unique to your project. I recommend you don't use your main project namespace, or at least add `\\Vendor` to the end.

**blacklist**

This is a list of packages you don't want to prefix. Matching packages will not be scanned for namespaces, but will still have code rewritten if it contains namespaces from other non-blacklisted packages.

**autorun**

Setting this value to true automatically runs the isolation process before every `dump`.

**require-dev**

By default, only `require` packages are scanned for namespaces, and `require-dev` packages are ignored (as above, they will still have code rewritten if they contain namespaces from other packages).

Setting this value to `true` includes the `require-dev` packages in the scan, and any found namespaces will be prefixed.

**replacements**

This is a place for manually fixing things in the vendor code that either were not detected and replaced, or replaced when they should not have been.

After each file has been parsed and rewritten, if there is an entry in the replacements list, it will do a string replace on the file.

String replacements should be idempotent, or things will break on multiple executions.

The syntax is:

```
"replacements" : {
    "path/relative/to/vendor/root/file.php" : {
        "search" : "replace",
        "search" : "replace",
    },
    "path/relative/to/vendor/root/file.php" : {
            "search" : "replace",
            "search" : "replace",
        }
}

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

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 ~522 days

Total

4

Last Release

1437d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0499fdd6338e1520be3ab6776948652c429291c08b79504a2eec2315d73787ab?d=identicon)[And](/maintainers/And)

---

Top Contributors

[![logical-and](https://avatars.githubusercontent.com/u/1403109?v=4)](https://github.com/logical-and "logical-and (7 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/and-isolate-composer/health.svg)

```
[![Health](https://phpackages.com/badges/and-isolate-composer/health.svg)](https://phpackages.com/packages/and-isolate-composer)
```

###  Alternatives

[psy/psysh

An interactive shell for modern PHP.

9.8k545.6M719](/packages/psy-psysh)[zircote/swagger-php

Generate interactive documentation for your RESTful API using PHP attributes (preferred) or PHPDoc annotations

5.3k132.9M468](/packages/zircote-swagger-php)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k26.2M1.8k](/packages/infection-infection)

PHPackages © 2026

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