Skip to content

Latest commit

 

History

38 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Vendor Isolator

Composer plugin to isolate project dependencies by prefixing their namespace.

Requirements

How it Works

  • It registers itself as a Composer plugin when you add it to your project through the extra.class directive in the composer.json file pointing to WPElevator\Vendor_Isolator\Plugin in php/class-plugin.php.

  • It hooks into pre-autoload-dump and post-autoload-dump Composer 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 vendor directory, 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 like Nette\SmartObject resolve to the prefixed namespace, while imports of global classes such as use Throwable; are left as is.

Credits

A fork of and/composer-isolation.

About

[READ ONLY] Isolate Composer vendor dependencies under a custom namespace prefix

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages