[Improvement] Mail: Adapter for Mustache Engine#11173
[Improvement] Mail: Adapter for Mustache Engine#11173fhelfer wants to merge 4 commits intoILIAS-eLearning:release_11from
Conversation
There was a problem hiding this comment.
Thank you very much for the PR!
I would love it, if we could follow @mjansenDatabay suggestion, but other than that I welcome this change. (Approval for both Test and User, although I'm not sure that Test actually depends on the Mail-Template-Engine, I think it depends on an alternative template engine based on mustache, but this is for later).
Best,
@kergomard
|
Hi @kergomard, we are currently working on removing the We hope the changes are understandable and acceptable from your perspective, and that the motivation behind this refactoring is clear. We would very much appreciate it if you could briefly review the modifications affecting your components. Best regards, |
|
Thanks @kergomard, lightning fast, even too fast for me! 😉 |
Introduces
TemplateEngineInterfaceandTemplateEngineFactoryInterfacein the Mail component, plus a Mustache-based implementation (MustacheTemplateEngine, MustacheTemplateEngineFactory).Mail, User, and Test now depend on these interfaces instead of Mustache_Engine or ilMustacheFactory.
Why: Direct dependencies on third-party libraries make the code harder to test, maintain, and change. An abstraction layer lets us mock the template engine in tests, swap implementations later, and keep the Mail component independent of a specific library.
ilMustacheFactory is removed. Use $DIC->mail()->templateEngineFactory() instead of mustacheFactory().