typo3/class-alias-loader
Composer plugin that adds backwards-compatible class aliases for renamed PHP classes. Packages declare alias map files in composer.json; the loader rewrites vendor/autoload.php and transparently calls class_alias() when old names are requested. No-op when no maps exist.
class_alias() glue or maintaining fork patches, adopt a small MIT Composer plugin. Best when the need is narrow: static old→new class mappings.Adopt when:
typo3/class-alias-loader alias maps and want those aliases resolved transparently.composer dump-autoload rewriting vendor/autoload.php.Look elsewhere when:
config/app.php, AppServiceProvider, Facade::alias()), not class renames.composer.json to add alias maps.Executives: This is a small, MIT-licensed Composer plugin that lowers the cost and risk of renaming PHP classes in packages. It lets us ship modernization work without forcing every consumer to upgrade at once, extending compatibility windows and reducing emergency patches. It is not a silver bullet: value is highest if we maintain shared Laravel/PHP packages or depend on libraries that already publish alias maps. Recommend a time-boxed pilot on one package with a real rename, measure consumer upgrade friction, then decide.
Engineering: The plugin hooks into Composer’s autoload dump and lazily registers class_alias() for old class names when requested. Configure alias maps under extra.typo3/class-alias-loader.class-alias-maps; no map means no autoload change. It is Composer-agnostic, not Laravel-specific. Use it for static BC maps in package releases, not as a replacement for Laravel’s service container/facade aliases. Validate with composer dump-autoload, test old and new class names, and pin a known-good version. Note the small ecosystem (44 stars, 0 dependents) and the vendor/autoload.php mutation, so treat it as a targeted compatibility tool rather than a broad platform dependency.
How can I help you explore Laravel packages today?