lib/Rex/CLI.pm: display a warning when/if Rex::Template is loaded.#1512
lib/Rex/CLI.pm: display a warning when/if Rex::Template is loaded.#1512monsieurp wants to merge 1 commit intoRexOps:masterfrom
Conversation
690a313 to
da8538c
Compare
d709f35 to
10f1ecc
Compare
There was a problem hiding this comment.
Thanks for this contribution as well, @monsieurp!
Hmm, quite a few core modules depend on Rex::Template so I'm afraid we can't simply deprecate it like that. I'd say we have to make sure the internal template-processing keeps working as before (and without deprecation warnings if not used directly).
We might need to move the discussion and design part back to the original #1475 issue. As briefly mentioned there, my preferred way would be to see if we could migrate the internal custom logic of Rex::Template to something like Text::Template::Simple (which seems close enough syntax-wise), and then perhaps making Rex::Template::NG to be an alias of Rex::Template (with a deprecation notice upon import).
What do you think about that?
| use Data::Dumper; | ||
|
|
There was a problem hiding this comment.
Is there any reason why Data::Dumper is also removed in this context about Rex::Template::* deprecation?
There was a problem hiding this comment.
This module is unused in CLI.pm.
| # Check whether Rex/Template.pm | ||
| # or Rex/Template/NG.pm modules are loaded. If there are, | ||
| # they should be present in the %INC hash. | ||
| sub check_template_modules { |
There was a problem hiding this comment.
We have Rex::deprecated to mark things deprecated in Rex core in a uniform way. That might come in handy here too. Or perhaps during import time of Rex::Template and Rex::Template::NG.
| Rex::Logger::info( | ||
| "Please consider migrating to a more modern template engine.", "warn" ); | ||
| Rex::Logger::info( | ||
| "Text::Template::Simple, Template::Toolkit, etc. As usual, CPAN is you friend.", | ||
| "warn" | ||
| ); |
There was a problem hiding this comment.
What do you think about pointing to Rex::Template::TT as a readily available and recommended external module, and point to the docs about how to set one's own custom templating functions:
- set_template_function config option
- template_function command
Fixes #1475.
This PR is an attempt to fix #1475.
Checklist