You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 a str_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).
The text was updated successfully, but these errors were encountered:
👎 , 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.
stecman
changed the title
Use a tempting engine for generating hooks
Separate shell hook templates from PHP code
Aug 30, 2015
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).
The text was updated successfully, but these errors were encountered: