Article
Zend Framework 2 Maintenance Center
Map ZF2 modules, ServiceManager, and routing so you can plan a verified laminas-migration instead of a blind namespace search-replace.
Zend Framework 2 introduced the modular application layout most teams still recognize: module/ directories, Module.php, and configuration merged through the ServiceManager. If your composer.lock lists zendframework/zendframework or component packages in the 2.x line, this hub is your starting map—and Laminas migration tooling is likely in scope.
Signature ZF2 artifacts
config/application.config.phplisting modulesmodule/Application/Module.phpimplementinggetConfig()/getServiceConfig()- Factories and invokables under
service_managerkeys - Routes in
module.config.phpunderrouter→routes
// LEGACY ZF2 module config fragment
return [
'service_manager' => [
'factories' => [
'My\Service\Invoice' => 'My\Factory\InvoiceFactory',
],
],
'controllers' => [
'invokables' => [
'My\Controller\Invoice' => 'My\Controller\InvoiceController',
],
],
];
Deep dives in this center
- Modules — load order, shared config, and module boundaries
- ServiceManager — factories, aliases, and plugin managers
- Routing — segment/literal routes and controller resolution
- ZF2 migration — path into Laminas with backup and testing gates
// MODERN after laminas-migration (namespaces rewritten)
return [
'service_manager' => [
'factories' => [
\My\Service\Invoice::class => \My\Factory\InvoiceFactory::class,
],
],
];
Do not confuse ZF2 with ZF1
ZF2 apps already use Composer in supported setups. ZF1 trees with a bolted-on composer.json for one library are not the same. Confirm major version before running laminas-migration migrate. Official scope: ZF version 2/3 series (plus Apigility/Expressive)—see Laminas migration docs.
Cross-links: flagship ZF→Laminas guide, import existing PHP project, Composer platform checker.
Related reading
- Migrating Zend Framework to Laminas (Complete Guide) Deep, verified migration from ZF2/ZF3 (and Apigility/Expressive) to Laminas using laminas-migration: Composer…
- Zend Framework 1 and PHP 8: Compatibility Reality Check ZF1 is not covered by laminas-migration like ZF2/ZF3. Unverified “PHP 8 compatible” claims, typical breakages…
- Zend Framework History: ZF1, ZF2, ZF3, and Laminas A maintainer-focused timeline of Zend Framework major generations and why Laminas is the official open-source…
- Zend Framework 3 Components Inventory List the zendframework/zend-* components you actually use so Laminas migration and PHP upgrades stay proporti…
- Composer Practices for Zend Framework 3 Apps Lockfiles, platform config, abandoned zendframework packages, and safe preparation for laminas-migration.