widmogrod / zf2-assetic-module

Zend Framework module for Assetic
146 stars 62 forks source link

Remove Closure for 'AsseticBundle\Configuration' and create a factory class instead #166

Open parktrip opened 7 years ago

parktrip commented 7 years ago

The use of the Closure for 'getServiceConfig' in Module.php

public function getServiceConfig() { return array( 'factories' => array( 'AsseticBundle\Configuration' => function (ServiceLocatorInterface $serviceLocator) { $configuration = $serviceLocator->get('Configuration'); return new Configuration($configuration['assetic_configuration']); } ), ); } prevents the use of caching configuration in zf (https://framework.zend.com/manual/2.4/en/tutorials/config.advanced.html) has Closures can't be serialized

Would it be possible to have instead a Factory in your module ?

Thank you in advance

widmogrod commented 7 years ago

I will gladly accept PR with Factory :)

parktrip commented 7 years ago

Dear Widmogrod,

I have just submitted PR #167 As this is my first PR, don't hesitate to tell me if I did something wrong.

Regards,

widmogrod commented 7 years ago

Great job!

widmogrod commented 7 years ago

I released version 2.2.0

parktrip commented 7 years ago

You are welcome ! Thanks for this module