zored / zf2-to-3
Hacks for migrating from ZF2 to ZF3.
1.0
2018-01-19 21:38 UTC
Requires
- php: >=5.6
- zendframework/zend-servicemanager: >=2.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.10
- php-coveralls/php-coveralls: ^2.0
- phpunit/phpunit: ^5.0
This package is not auto-updated.
Last update: 2024-11-24 07:01:44 UTC
README
Hacks for migrating from ZF2 to ZF3.
Why?
To fast-fix your code before fully moving to ZF3.
How?
use \ZF2TO3\ZF2To3AbstractFactoryTrait;
in abstract factories.use \ZF2TO3\ZF2To3FactoryTrait;
in factories.use \ZF2TO3\ZF2To3ControllerTrait;
in controller itself if it depends on service locator.use \ZF2TO3\ZF2To3ServiceLocatorAwareTrait;
and custom constructor to get rid ofServiceLocatorAware
.- Change controller configurations:
<?php return [ 'controllers' => [ // BEFORE: 'invokables' => [ 'App\Some' => \App\SomeController::class ], // AFTER: 'factories' => [ // Controller should be real class: \App\SomeController::class => \ZF2TO3\ZF2To3ControllerFactory::class ], ], ];
- Read the migration docs and get rid of these hacks!