Dependency injection in legacy projects

PHP-DI is an easy to integrate IoC container that you can use in legacy projects or in apps without a framework.

I regularly have to use Zend Framework 1 for some legacy apps. If you're used to having an IoC container to inject dependencies then not having one is a big pain. Here's a guide on how to integrate it in ZF1:

http://php-di.org/doc/frameworks/zf1.html

 

Join 9,500+ smart developers

Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.

No spam. Unsubscribe anytime. You can also follow me on X.

Found something interesting to share? Submit a link to the community section.