PHP-Scoper prefixes all PHP namespaces in a file/directory.
Latest release: none
PHP >= 5.5
PHP-Scoper is a tool for adding a prefix to all PHP namespaces in a given file or directory.
PHP-Scoper's goal is to make sure that all code in a directory lies in a distinct PHP namespace. This is necessary when building PHARs that
- bundle their own vendor dependencies
- load code of arbitrary PHP projects
These PHARs run the risk of raising conflicts between their bundled vendors and the vendors of the loaded project, if the vendors are required in incompatible versions.
Use PHP-Scoper like this:
$ php-scoper add-prefix MyPhar\\ .
The first argument is the prefix to add to all namespace declarations and class usages. The second argument is one or more files/directories which should be processed.
Contributions to are very welcome!
- Report any bugs or issues you find on the issue tracker.
- You can grab the source code at PHP-Scoper's Git repository.
All contents of this package are licensed under the MIT license.