ddelrio1986 / NinjaAuthorization

2 stars 2 forks source link

Closure in module config will cause fatal if config cache is enabled #6

Open dzhibas opened 10 years ago

dzhibas commented 10 years ago

instead of putting it to module.config.php you can move all closures into Module.php or seperate Factory class which implements FactoryInterface.

in that case application with your module will be able to cache configuration and factories with closures will be loaded in your Module.php

ddelrio1986 commented 10 years ago

Thanks for pointing this out. I am actually just finishing a revamp of NinjaServiceLayer which this module is based on. I am removing all closures in the module config and implementing proper dependency injection with the use of constructor injection. I am performing the actual injections with classes which implement Zend\ServiceManager\FactoryInterface. Once the v2 of the NinjaServiceLayer is done I will updating this module as well. I will keep this open until that is complete. BTW once both modules are complete v2.1 on each will be for the addition of unit tests.