humbug/php-scoper
PHP-Scoper prefixes your project and its dependencies into a unique namespace to avoid conflicts, especially when building PHARs that bundle vendor code and run alongside other PHP projects with overlapping packages or versions.
composer install is prohibited).Adopt if:
Look elsewhere if:
create_function) or unsupported PHP features (see Limitations).For Executives:
"PHP-Scoper lets us package our PHP tools as single, self-contained files (PHARs) with locked-in dependencies—eliminating version conflicts and reducing support costs. For example, we could distribute our CLI tool as a single executable (no vendor/ folder needed), improving security and deployment simplicity. This aligns with our goals of [X: cost savings/offline support/global reach] while maintaining compatibility with existing PHP ecosystems."
For Engineering: *"This tool automates namespace isolation for PHARs, solving the ‘vendor hell’ problem when bundling dependencies. Key benefits:
src/ and vendor/.composer dump-autoload to ensure autoloading works post-scoping.Trade-offs:
call_user_func() with strings).Proposal:
php-scoper into CI/CD (e.g., GitHub Actions) for builds.How can I help you explore Laravel packages today?