From Zend Framework 1 to Laminas

Hi!
I have a project for my website developed by Zend Framework version 1 and I would like to transform it in a Laminas project.
How can I do it easily?
Thanks!

There used to be a document outlining upgrading from ZF1 to ZF2. This is a good place to start. Going from ZF2 to laminas is a much smaller jump with a bit of minor refactoring. But this is a major job not to be taken lightly.

Start out with making sure your code is namespaced.

I don’t understand this: “Start out with making sure your code is namespaced”. Can you explain me?

Hello @chiavarini95

Short answer: It cannot be done easily.

The architecture made some fundamental transition from ZF1 to ZF2. As @erlicthemad pointed out, the migration path from ZF2 to Laminas is much simpler. The key question is, is it worth it making a gradual upgrade or might a transition to a PSR-15 middleware application based on e.g. Mezzio be the more attractive option in the long run.

At our company we made the transition of our custimized framework from ZF1 to Mezzio. For running implementations it’s not as simple. We have two approaches for modernizing ZF1 applications, both using the strangler pattern. In the first approach we introduce Mezzio and run both applications in parallel. In the second approach we introduce modern components, such as laminas-servicemanager and laminas-config-aggregator. Both approaches make gradual changes away from ZF1.

Cheers,
Andi

Thanks @arueckauer!
I’m doing an universitary project…therefore i don’t need a professional solution or something like that. I only have to develop and upload my website online but I know only PHP and Zend Framework 1. How can I solve my problem in your opinion?

Two options:

  1. Upgrade from ZF1 to Laminas as described above.
  2. Start fresh with Laminas, Mezzio or another framework of your choice.

In your opinion which is the easily solution?

Depends on the existing application.