Open stecman opened 9 years ago
:-1: , because this would force any project using this library also have Twig (or similar) as a Composer dependency just to generate hooks.
If array with hook content doesn't sound right, then we can just move out each hook template into separate sh/zsh file in say bin
sub-folder. Then we do file_get_contents
and replace what's needed.
I kind of agree, though I'm sure there are some light-weight templating libraries that mitigate the large dependency issue (if it even is an issue?). The scripts should definitely be extracted to separate files, so we'll go with that for now - thanks.
Currently the templates for shell hooks live in PHP code as a static array of nowdoc strings (
HookFactory::$hooks
). At runtime these templates are populated using astr_replace
call.In the interest of keeping this part of the code maintainable, these templates should really be extracted from the PHP code and rendered with a more common templating system (Twig would be my choice).