Download the PHP package wpelevator/vendor-isolator without Composer
On this page you can find all versions of the php package wpelevator/vendor-isolator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wpelevator/vendor-isolator
More information about wpelevator/vendor-isolator
Files in wpelevator/vendor-isolator
Package vendor-isolator
Short Description Composer plugin to isolate project dependencies by prefixing their namespace
License MIT
Informations about the package vendor-isolator
Vendor Isolator
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 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.
- It prefixes the single part imports of dependency namespaces such as
use Nette;so that relative names likeNette\SmartObjectresolve to the prefixed namespace, while imports of global classes such asuse Throwable;are left as is.
Credits
A fork of and/composer-isolation.