-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace closures in config/service with factories #22
Comments
I think that's a good idea @lenada - and in fact service classes are easier for others to extend, also, so double bonus :-) I'm happy to create the classes if you're happy to report back on correct caching once it's done? |
@mtudor cool! I was wondering if you would mind moving away from the traits used by the Module and move towards a more classical zf2 Module approach? I will attach a PR ;) |
I quite like the AbstractModule / Trait stuff actually - probably would rather stick with that as it makes organising config very straightforward and it's common across my modules. I don't think it's incompatible with also using service classes though? Assuming we're talking about the same thing! Just need to take the closures out and extract them to service classes and then replace the reference to them in the services.config.php file. I'm keen you not do any wasted work so you might like to hold off on doing too much until we've had a chance to discuss, or alternatively I can pop the factory classes together and you can do the checking for caching? |
sounds good, you popping the factory classes together, I will test again 👍 |
when playing around with sysdig and php opcode cache,
I discovered that the 3 service config files are being read from the file system on every request.
The opcode cache does not hit because they all contain closures.
By using factories we will add a bunch of new files but it will perform better with opcode cache enabled.
The text was updated successfully, but these errors were encountered: