Migration de Zf 1.11 vers laminas

Correct, there is no automated migration via script or something else. Some approaches and concepts are too different between version 1 and version 2 of ZF. The topic “dependency injection”, for example, is missing in ZF1. Also the old registry implemented via singleton pattern with global state. These are all old habits and bad practices that have been cut off.

My advice for old ZF1 application is to find a way for a soft migration. This means, for example, to clean up all controllers, create a decoupled model layer and replace old libraries like Zend_Date, Zend_Mail, Zend_Dojo, ZendX_JQuery etc.
Then it becomes easy to change the controller layer.

But there is an alternative: integrate an old ZF1 application into a Mezzio application, use the old application in a middleware.
Here is one example application that illustrates the idea:

More ideas can be found on GitHub and in some blogs, like compatibility layer or using ZF2 features in ZF1 applications.
I prefer the idea of the middleware and I use it myself in different applications.

1 Like