Today marks the release of the long-anticipated Zend Framework 3.0 (ZF3), the first major release in four years.
With the announcement, many will be wondering what impact this will have on existing projects, projects in active development, and projects in the planning stages. In this article we’ll take a look at the the basic changes that ZF3 brings, how this release compares to the transition from ZF1 to ZF2, and how the changes might influence your projects.
What’s New in ZF3
Zend Framework 3 includes:
- Increased performance – up to 4X faster applications under PHP 5, and even better using PHP 7
- PHP 7 support
- Improved documentation for each component repository
- Expressive, a PSR-7 middleware microframework that focuses on simplicity and interoperability
ZF3 requires PHP 5.6 or later, and it is recommended that you use the latest PHP version whenever possible.
It is no longer recommended to install the Zend Framework package directly. The package is a metapackage that aggregates all components (and/or integrations) originally shipped with Zend Framework. In most cases, you will want a subset, and these may be installed separately.
Zend Framework v2 to v3 has been intended as an incremental upgrade. The core team have even made efforts in the past year to provide forward compatibility features in v2 versions of components, to allow users to prepare their code for upgrade.
See the official README on GitHub for more details.
Comparison with The ZF1 to ZF2 Transition
If you have any experience with making the transition from ZF1 to ZF2 on a project, you may be wary of the ZF2 to ZF3 transition. There was no clean migration path from ZF1 to ZF2, because major architecture revisions made ZF1 and ZF2 fairly incompatible. The good news is, that major backward compatibility break was an investment that is still paying dividends with the release of ZF3. The transition from ZF2 to ZF3 is very smooth.
Considerations for New Projects
If you are just starting a new project, unambiguously you should use ZF3/Expressive. There is no reason to consider sticking with ZF2 for anything new. The skills your developers have acquired writing ZF2 applications are directly applicable, and there is a very minimal learning curve for an experienced ZF2 developer picking up ZF3.
Considerations for ZF2 Projects in Development
If you have a project under way that has not yet been released, there is a good chance you are already working with the later minor release of ZF2, which started deprecating things that require refactoring to work with ZF3. It’s worth considering moving a project in development to use the new ZF3 MVC package as soon as feasible, because the cost of refactoring should be quite low, assuming you’re already using the ZF2 MVC package with proper use of the service locator. If you’re unsure what the level of effort might be, we’d be happy to help you do an assessment, and create an upgrade plan for your project.
Considerations for Existing ZF2 Projects
If you are maintaining a stable, already released project that uses ZF2 MVC, you probably don’t need to rush to upgrade immediately. You should fold the upgrade plan into your feature release roadmap, and do it when it makes sense in that context.
Considerations For Existing ZF1 Projects
Today was also the official announcement of the ZF1 End of Life (EOL)Â three months from today, on 28 September 2016. This creates new urgency for projects still running on ZF1 to upgrade. Soliant has real-world experience with the process of updating ZF1 projects. We recently posted lessons learned migrating ZF1 to ZF2. The identical considerations apply to migrating ZF1 to ZF3. If you need to upgrade from ZF1, we’d be happy to help you do an assessment, and create an upgrade plan for your project.
Questions?
Have questions? Let us know in a comment below, or contact our team directly. You can also check out our other posts on software development.