wpelevator / vendor-isolator
Composer plugin to isolate project dependencies by prefixing their namespace
Installs: 109
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Type:composer-plugin
pkg:composer/wpelevator/vendor-isolator
Requires
- php: >=7.4
- composer-plugin-api: ^2.0
- nikic/php-parser: ^5.0
Requires (Dev)
- composer/composer: ^2.0
This package is not auto-updated.
Last update: 2025-10-28 19:22:28 UTC
README
Composer plugin to isolate project dependencies by prefixing their namespace.
Requirements
- PHP 7.4 or later
- Composer v2
How it Works
-
It registers itself as a Composer plugin when you add it to your project through the
extra.classdirective in thecomposer.jsonfile pointing toWPElevator\Vendor_Isolator\Pluginin php/class-plugin.php. -
It hooks into
pre-autoload-dumpandpost-autoload-dumpComposer events and uses nikic/php-parser to rewrite the namespaces and classname references for all non-development dependencies. It ignores all global function and classes.
To Do
- Describe how this is different from php-scoper and other projects.
Features and Limitations
-
It only rewrites the non-development dependencies in the
vendordirectory, therefore your application code must reference the isolated dependencies by their prefixed namespace. -
It doesn't replace function definitions and calls in the global namespace. Any definitions and calls to global functions will remain in the global namespace after the transformation.
Credits
A fork of and/composer-isolation.